Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport does not work at customer site

Status
Not open for further replies.

mthompso

Programmer
Apr 9, 2002
22
CA
I have a simple report with one subreport. The subreport does not display any records at the customer site, although it works fine on my computer.

The main report is selected against the Sites table on the Sites.ProfacNumber field.

The subreport's name is HazMaterials.

Its parameter field is PM-Sites.ProfacNumber. The edit box shows a value type of string and discrete values are allowed.

In the VB code which calls the report the HazMaterials subreport is advised of the location of the database by this code in the frmViewer.Form_Load procedure:

Code:
Set crxSubreport = Report.OpenSubreport("HazMaterials")
For Each crxDatabaseTable In crxSubreport.Database.Tables
    crxDatabaseTable.Location = sPathFPPM
Next crxDatabaseTable

This is a .dsr, Crystal Reports 8, Microsoft Access97 database, VB 6 development language.

What am I missing or what is not getting picked up? Do I have to feed the HazMaterials report something more?

Regards - Miles Thompson
 
the subreport has to be changed at the customers site to point to the correct Location, changing the main reports is only for the main, go to the sub and edit and then link it properly
 
Konad,

Thank you for your reply. The code in my original message is to tell the subreport where the data file is located. "sFPPM" is the variable which holds the path to and the name of the database.

If I comment that out, then an error occurs at the customer site that the HazSiteCondition table (on which the HazMaterials subreport is based) cannot be found.

Do I need to put a suppressed field from HazSiteCondition in the main report? The links look OK.

Miles Thompson
milesthompson@ns.sympatico.ca
 
Silly question but is the database at the client site EXACTLY like the one at your office.

perhaps there is a difference and the Crystal main report and subreport need to be verified against the client's database.

Even the database being different by one unused (in this report) field is enough for Crystal to choke before it starts.
JimBroadbent@Hotmail.com

Reward good advice with a star, it reinforces us and helps others find answers to their problems.
 
>Is database different

That's a good point, and one I had not thought of. Not in this case, however, as any fields I've modified or added are checked for on program load and created if necessary.

There's an interesting subtext here. The report in question is a .dsr, compiled into the program and the client does not have Crystal Reports installed. There is no practical way of verifying the report against the database, but I am assurred of matching databse structures. What if they were different? Would CR throw an error?

Thank you for the suggestion.

Miles Thompson
milesthompson@ns.sympatico.ca
 
I don't launch from VB usually but I recall that there is a call to verify the database in VB. There is nothing you can do from VB at run time to correct the condition if the answer is false but you could use that to send a maintenance message to the user and avoid a GPF or hanging of your app.

So you have checked their database and everything is EXACTLY the same, eh....are you feeding the reports parameters from VB...can you test a simple case at the clientsite where you have inspected the data for the subreport and know it exists??

Do you have other reports at that site launched in the same manner, that work fine? JimBroadbent@Hotmail.com

Reward good advice with a star, it reinforces us and helps others find answers to their problems.
 
Ngolem,

Sorry for the delay in replying, but it took some time to get the client to fire up Access and inspect records, structure etc.

The database structures are identical.
The key values are the same: type and length, and are indexed when referred to as foreign keys.

I added debug.print code to the Load event of the report's form to show the record selection formula for the sub report and the value of the parameter field. At this stage it does not show any value for the latter.

The client keeps saying "There's nothing there.", so I'm having him fax "nothing". I'm not able to determine if the headers, etc. are displaying.

I have added fields to the subreport to display the values of its parameter field and lookup code in the sub-report's header. Those display when I run the report and the parameter field has the correct value. I do not know how that will work at the customer site, as I only sent that revision this morning.

There is one quirk. All of the key fields on which the relations are based are left packed with leading zeros, e.g. " 00000007". If the client strips the leading zeroes off in the HazSiteCond table (the one reported on), those records display. Not correctly, the same records will display for any property he requests a report on.

I'm finding this whole thing frustratingly opaque. Is there a recommended step-by-step debugging process? The Manual only shows how to do this, not what to do when things go wrong. <g>

Memory jogger - this is a .dsr with an embedded sub-report.

There are no other reports at the site. This is the first, and was adapted from an existing stand-alone report (.rpt). I had to go the .dsr route so that I could load and dispaly images from the file system in the report detail band.

Regards - Miles Thompson
milesthompson@ns.sympatico.ca
 
&quot;I added debug.print code to the Load event of the report's form to show the record selection formula for the sub report and the value of the parameter field. At this stage it does not show any value for the latter.&quot;

Should it show the parameter field value at this point? If it does on your machine then the user is not inputting the parameter properly??? Is this value obtained from a VB dialog screen somehow...and the user is ignoring that part of the screen?

&quot;There is one quirk. All of the key fields on which the relations are based are left packed with leading zeros, e.g. &quot; 00000007&quot;. If the client strips the leading zeroes off in the HazSiteCond table (the one reported on), those records display. Not correctly, the same records will display for any property he requests a report on.&quot;

SOOOOO...the tables are not necessarily identical. This is a string field and perhaps you are selecting on the basis of having those zero's there.

Is it alpha/numeric or simply a numeric string. If it is numeric and can be stripped of zeros....sometimes...by the client then use a formula to convert all usuages of that field to a number and perform all of your functions on the basis of it being a number.

tonumber({Table.zeropackedNumericString})

converting to a number this way will avoid those errors. Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top