Missing Data: calling Crystal Reports from J#

What is the best J# Book?

  • Microsoft J#.NET Core Reference - Microsoft Press

    Votes: 1 50.0%
  • J# Wrox Press Inc

    Votes: 1 50.0%

  • Total voters
    2

LindaC

New member
Joined
May 30, 2003
Messages
4
I have a J# Interface that calls a crystal report. The report shows up but with no data. I am successfully logging onto the database in my report but still, no data. Has any one experienced this? Is it a problem with my code?

This is my first J# app and I have tried everything but cannot resolve the problem. Please help!

The following is my code:

// Initialize the page
// Parse command line arguments
//Validate Report Param (Determines which Crystal Report To Use)
String tRpt= get_Request().get_Params().get_Item("txtReport");
if((tRpt == null)||(tRpt == ""))
{
tRpt="c:\\inetpub\\wwwroot\\j\\crBudgetReport.rpt";
}
else
{
tRpt="c:\\inetpub\\wwwroot\\j\\"+txtReport.Trim()+".rpt";
}
if (!this.get_IsPostBack())
{
//Fill Datasets
daMasterData_CurrentYear.Fill(dsReportData1);
daReportData_CurrentPeriod.Fill(dsReportData1);
daReportData_LastPeriod.Fill(dsReportData1);
daReportData_Detail.Fill(dsReportData1);
daReportData_EMALog.Fill(dsReportData1);
}
// Call Crystal
InitializeComponent();
CrystalDecisions.CrystalReports.Engine.ReportDocument crDoc;
crDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
crDoc.Load(txtReport);
crDoc.SetDataSource(dsReportData1);
crReportViewer.set_ReportSource(crDoc);
 
Last edited by a moderator:
I never really worked with Crystal Reoprts but I noticed your poll. I wouldnt recommend buying a MS Reference. It contains things that you can find in your help files. Go with something thats not a core reference. You would be better buying some other book to learn then reference.
 
Problem Solved

OK, I figured this out! An error on my part...

I should not have included the line:

InitializeComponent();

After I got my data. It reinitialized everything. Just like its supposed to. An oversight on my part, the line should have been placed before I retrieved the data, or left out entirely.

Linda
 
Back
Top