thukralz


Hello,

I'm using Report Viewer Control and everything works fine. But my problem is I have the same report shown two ways, handout/grid . Handout has less columns and grid has way more.

Now how can I accomplish this task I was thinking maybe have two subreports within the one main and hide/unhide accordingly based on user selection of handout or grid.

The problem is all my attempts are unsuccessful.

I will really appreciate if someone can help me on this.

Thanks a lot.

Harsimrat




Re: Report Viewer Control and VS 2005 ?

minority80


hmm.... how about creating 2 different reports and use if else statement to control which report to display on report viewer

not very clear on your requirements but just a suggestion... hth






Re: Report Viewer Control and VS 2005 ?

Harsimrat

OK, the subreports is kind of two reports also. Can you give me an example how to achieve this






Re: Report Viewer Control and VS 2005 ?

minority80

are you developing rdlc or rdl report

cos i was thinking if you want to use subreport, then you need 1 main report and 2 subreports.. while you can just use 2 reports to show the same result.... maybe you have your reason...

my idea was... create a combobox e.g. name cboView for the two options of display: handout ; grid

if (cboView.selectedvalue == "handout")

ReportViewer1.serverreport.reportpath = "................."

else

Reportviewer1.serverreport.reportpath="............"





Re: Report Viewer Control and VS 2005 ?

Harsimrat

It is .rdlc report (Client Side). Can you show me the code how to call from the code as I'm using VS designer and if I don't provide the name to the Report Viewer component is not happy.

2nd Type of Report :

Secondly, I have another problem where I think I have to use subreporting. I have 10 different type of formats, based on how user saved them. Say User picks 5 Reports to be displayed and all are of different types (formats) I need to display them in Report Viewer one per page, where I cannot say ReportViewer1.Localreport.reportpath as then all 5 Pages will be using the same format which is totally wrong.

In that case I need to have one main report and 10 subreports in it. Now based on the ID I know what type of report it is. So how can I hide/unhide other 9 for Page 1. Then so on on different pages in same reportViewer1 . Can you please explain the hide/unhide code or how this should be done.

Hopefully you can understand what I'm trying to achieve. If you want more clarity I can try to explain more better.

Please let me know.

Thanks,

Harsimrat





Re: Report Viewer Control and VS 2005 ?

minority80

i just found out my suggestion won't work for webforms in local mode...

u might find this useful

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=203247&SiteID=1

i think you might find more assistance in the other forum... HTH