Change to FormReportCustom

This forum is for programmers who have questions about the source code.
Post Reply
mowgli
Posts: 134
Joined: Fri Sep 14, 2007 1:42 pm

Change to FormReportCustom

Post by mowgli » Wed Nov 19, 2008 7:12 am

I'd like to change a line to set the Parameters value passed to RDL reports to the current patnum instead of null:
this.viewer.Parameters = "PatID="+FormOpenDental.CurPatNum.ToString();
This is so we can pass the currently selected patient number automatically for patient-specific RDL reports. If the report doesn't contain a parameter called "PatID," it ignores it. This only affects people who are specifically using the Open Dental Custom Reports menu. Used "PatID" instead of "PatNum" in case some might actually have "PatNum" designated as an RDL parameter. It would be nice to code it so "PatID" would be passed only if the report contained that parameter, but I don't know how that could be done.

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Change to FormReportCustom

Post by jordansparks » Wed Nov 19, 2008 7:47 am

I'm worried about this causing bugs in existing reports, of course. I don't have time to look at it and to try to understand the conseqeunces. So if you are very careful and try to test some of the existing reports, then I'm OK with it. Be aware that if it does cause a bug, I might have to quickly revert it. It sounds like a single line change, which is great because it would be easy to revert.
Jordan Sparks, DMD
http://www.opendental.com

mowgli
Posts: 134
Joined: Fri Sep 14, 2007 1:42 pm

Re: Change to FormReportCustom

Post by mowgli » Wed Nov 19, 2008 11:20 am

Since this Form is marked "true" to show the RDL parameters dialog, other reports will still work, unless one uses the exact "PatID" parameter, then it will enforce the currently selected patient--which should be an advantage, because it won't have to be keyed in. If the report has parameters in addition to that, then the PatID parameter in RDL needs to be marked "allow null" so the other fields can be filled with the PatID blank. We can change the PatID name to "XPat" just to make it much less likely that already existing reports will be affected.

Post Reply