Dear friends,

I need to make a report that would let the user to pick which columns he wants to see. I found how to do it here:

http://www.c-sharpcorner.com/UploadFile/uditsingh/CR1111022006055359AM/CR11.aspx

This works, but I still have two problems:

1)When you start the report, you see a page with several comboboxes (according to the number of fields available in the report). The comboboxes contain "Use Value..." string at the top, and then "None", and then all possible fields that we specified in our textfile. If you leave "Use Value..." selected, the report shows the column without any caption, with all 0's. Is it possible to hide somehow option "Use Value..." in the comboboxes, and show "None" by default?
2) On the report, when I press the Export button, instead of the exporting functionality, I am redirected again to the page where the column selection is made. How can I solve this problem?

Unfortunately, the author doesn't answer my questions.
Thank you very much in advance. I really need that to be solved.
Dmitriy

Recommended Answers

All 7 Replies

>When you start the report, you see a page with several comboboxes...?
Will you post code of your project?

I doubt the code would help. All specifics that make the report have dynamic columns are set in the .rpt file. That's why I gave the link to the article that explains how to do that.
I didn't code the report to show that page with column selection. It is generated automatically by Crystal, I think.

Thanks,
Dmitriy

Good news: I solved the first problem!
I still really need help on the second one:
2) On the report, when I press the Export or Print button, instead of the exporting or printing functionality, I am redirected again to the page where the column selection is made. How can I solve this problem?

Thanks,
Dmitriy

As I understand, my problem happens because pressing on any report's button causes postback that brings me back to the column selection page. E.g. if I press Pring button, and popups are allowed, a new Printer settings window will appear (which is good), but the report page will go back to the Column selection page.

Please! Help me solve this.

Thanks,
Dmitriy

Are you using UpdatePanel in your page? If yes, check the solution( see in the bottom) given in this thread.

Also check whether you are binding crystal report in each postback in page_load event. Try to call inital page load like below

if (!Page.IsPostBack)
{

    LoadCrystalReport();

  }

Ramesh, thank you very much for your answer.
No, I don't use UpdatePanel.
And checking for IsPostBack() doesn't help either, I think, because the report actually shows data on post back after submitting the column selection page (I believe it is considered the same page as the report). If I do checking, the report is empty.
I am already thinking that probably I should go away from using automatically generating column selection page by providing the parameters instead of just waiting for reports to ask for them...

Hi dpreznik, I am facing the same problem. can you provide me solution for it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.