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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport with no data

Status
Not open for further replies.

josemauricio

Programmer
Sep 2, 2003
65
BR
Hi dudes!

Here's my problem. I built a window service developed on VB .Net that is used to automatic send e-mails messages with an attachment pdf file. This pdf file is a report that is built using Crystal Reports 10 that is exrpoted to this file type. There's a subreport in this report. When I install the service on my machine and start it, everything works fine. But, when I install on the server, the report is generated with no data in the subreport. I've already done all kind of tests and noticed that there's data in the dataset that fills the subreport. I've put a header in subreport just to check if the subreport is really there in the main report and, yes, there it is! So, the problem is not the the missing data or not the missing report... the problem is just to know the missing what!!!

If someone has faced this issue sometime, I'll glade to know your experience.

Thanx since now!
 
I'd guess access rights, maybe the server is set up differently.

To check, try exporting the subreport and doing a test version, one which shows more than in the live report. For instance, are the records read but not shown? Has it somehow got another version.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanx for answer, Madwac.

I don't know if I understood, but I generate the subreport separatly and export to excel and, surprise! There is data on it... it just doesn't work when it is embedded in the main report. I think that I didn't mention, but tha data in the main report is shown.
 
Someone else will have to explain this, I can't see how something that works on its own should fail as a subreport, unless it is being passed something in Edit > Subreport Links.

I don't know VB.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Problem solved!

I don't believe how simple the solution was!

Well, on my code, I difined the datasource of the report and the subreport like this:

crFaturaDacasa.SetDataSource(DsImprimirFaturaLancamento1.DadosFatura)

crFaturaDacasa.Subreports("RptLancamentoFatura.rpt").SetDataSource(DsImprimirFaturaLancamento1.Lancamentos)

As you can see, I use one dataset wich is filled with to datatables. One for the main report and another to subreport. This code works perfectly on my machine, but when I execute the service on the server, no data was displayed in the subreport. I spent weeks looking for something that could help me, and I finally found a code that load a main report with just de dataset, without mention the datatable, like that:

crFaturaDacasa.SetDataSource(DsImprimirFaturaLancamento1)

crFaturaDacasa.Subreports("RptLancamentoFatura.rpt").SetDataSource(DsImprimirFaturaLancamento1.Lancamentos)

When I execute the service on the server, SURPRISE! It worked!!!!

So, that's it! I hope this information can be useful for someone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top