cancel
Showing results for 
Search instead for 
Did you mean: 

Group Tree issue, web form vs Win form?

Former Member
0 Kudos

Using Crystal Reports for Visual Studio 2010...

I am using the same report file for a Win form and web form version of the same utility program.  The report was built bases on a view to the database, and both programs populate the report based on a dataset which has the same columns with restrictive where clauses, based on user input prior to populating the report.

On the Win Form version, when the user clicks a group on the Group Tree, the report nicely navigates to the appropriate section of the report. However... on the Web version, the ReportViewer makes a return trip to the database, refreshing the data with the entire view, overwriting the original content.  In other words, out of lets say 50,000 possible records, if I ask for 50, they are displayed as I want, but in the web report, if I try and navigate to any of the 50, I get all 50,000 (an no navigation), an unwanted return to the database.

I am perplexed, as it is the same report file used by both versions.

I tried hiding the Group Tree panel (I don't need it), per instructions (CrystalReportViewer1.ToolPanelView = ToolPanelViewType.None;)

But that only closes the panel, and it is still available to the user to open (icon remaining). Is it possible to really make the Group Tree unavailable?

thanks,

Mark

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Mark,

In VS click on the Viewer and you'll see these properties:

You can hide them completely using this option.

Don

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you, that will do the trick. Now to implement Ludek's answer, as I can't even get to page 2 of a report without a database error; and I shouldn't be returning to the database!

Failed to retrieve data from the database.
Details:  [Database Vendor Code: 942 ] Failed to retrieve data from the database. Error in File FY_YTDbyCharge {56AAD9E2-04BF-4707-A2A3-3C0A4D3B24CE}.rpt:
Failed to retrieve data from the database.
Details:  [Database Vendor Code: 942 ]

0 Kudos

Hi Mark,

Great, now search for the DB issue, there are 1000's of posts on how to connect, debug and resolve DB connection issues.

That error is simply being passed through CR to you, search on what that error means to your DB.

Thanks

Don

Former Member
0 Kudos

Yes, it's not supposed to go to the database, as the source is a dataset. hence the need to have it in a session so no trip to the db will occur.

former_member183750
Active Contributor
0 Kudos

Hi Mark

The only time a report will prompt for database login if you are passing it a dataset is if the dataset does not match what it is expecting. I normally recommend the wiki Troubleshooting Issues with VS .NET Datasets and Crystal Reports as a good starting point, so please have a look at that, see if it helps point you towards a resolution.

- Ludek

Former Member
0 Kudos

In this case, the dataset matches the Report exactly. the first page displays properly, but clicking for page 2 results in the database connection attempt (Web viewer only, works fine on WinForm viewer).

former_member183750
Active Contributor
0 Kudos

Sorry Mark, the report is in session? Any action on the CR viewer causes a postback. This includes paging, zooming, drilling, etc., etc. From the behavior it looks like there is a postback occurring and of course the connection to the dataset is lost, so the report prompts for the last desperate thing to get the data.

- Ludek

0 Kudos

Are you keeping the reports in Session and using the PostBack method?

If not then search for it, again lots of sample on how to

Don

Former Member
0 Kudos


Ludek,

What I wish to do is follow the instructions for placing the report in a session, per your suggestions above:

     Place the report in session. See

     KBA 1985571 - How to use sessions in web applications using the Crystal Reports viewer (the complete cod...

OK, since I'm new at this, where does the code go? I can't seem to resolve RAPPBasePage, and I admit that without more specific directions on the linked page, I'm more than a bit lost with this.

Thanks,
Mark

------------------------

  • Below is a complete code that describes how to ensure the report is in
    session:

public partial class Reports : RAPPBasePage

{   

      private ReportDocument crReportDocument;

      protected override void Page_Init(object sender, EventArgs e)

      {

           //connect method to master event

           base.Page_Init(sender, e);

      }

     [. . .]

Former Member
0 Kudos

Well, I got it into a session, after much trial and error. I even opened back the Group Tree, and it functions perfectly. Search functions perfectly. Navigate to next page won't go past page 2, however. It will go to last page, but navigate back one goes to page 1.


former_member183750
Active Contributor
0 Kudos

Place the report in session. See

KBA 1985571 - How to use sessions in web applications using the Crystal Reports viewer (the complete cod...

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter