November 11, 2011 at 8:08 am
I am adding the report to a reportviewer from the codebehind. But due to some reason the page is loading twice. Is there is way to fix it, so that it loads only once as if it loads twice, I loose all the data from dynamic controls?
Code I am using is:
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
ReportViewer1.ServerReport.ReportServerUrl = New Uri("ServerURL")
ReportViewer1.ServerReport.ReportPath = "ReportPath"
ReportViewer1.ServerReport.Refresh()
Thanks!!
November 11, 2011 at 8:11 am
What is loading twice? The report or the asp page?
November 11, 2011 at 8:14 am
asp page is loading twice. As soon as I add the following report path line it loads again.
ReportViewer1.ServerReport.ReportPath = "ReportPath"
I have all this code on the Page_Load. I tried to put it some other place but it did not work.
Thanks!
November 11, 2011 at 8:21 am
if you do if not page.ispostback
can it solve your issue?
I know it's hack but that's all I can offer at this point.
All I know from reportviewer control I learnt there => http://www.gotreportviewer.com/
November 11, 2011 at 8:26 am
I already tried it, but if I use this I am loosing all the data I have in dynamic fields. So i need to find some other solution so that I can stop postback.
But thank you anyways.
November 11, 2011 at 8:32 am
jain1.siddharth (11/11/2011)
I already tried it, but if I use this I am loosing all the data I have in dynamic fields. So i need to find some other solution so that I can stop postback.But thank you anyways.
That sounds fishy (with my very junior experience in Asp.net). I think you're overlooking something obvious.
What have you seen in stepping through the whole page load?
November 11, 2011 at 8:39 am
First time the page loads every thing correctly. It adds the report to the page, and gets data from the dynamic controls of previous page. But some how as soon as the page is loaded once, it again goes back to the page_load event and does all the steps again. If I use "If Not Page.IsPostBack" than it looses all the dynamic data. If I dont use it, page gives the error that there is no data on the previous page.
The code I am using to get the dynamic fields data is:
Dim fieldValues As New AgeofUnitsFieldsListing
Dim ctl00 As MasterPage = CType(FindControl("ctl00"), MasterPage)
Dim MainContent As ContentPlaceHolder = CType(ctl00.FindControl("ContentPlaceHolder1"), ContentPlaceHolder)
I know that I might be doing very small mistake, but dont know where !!!! 🙁
Thanks
November 11, 2011 at 8:41 am
I've used RVC and I didn't have that issue.
I don't have access to that code anymore so that part of the discussion is a little moot.
I'm sure there's a way for the page NOT to reload. Maybe try another way to load the report.
My way was to use a local dataset as the datasource. Maybe that's the difference.
November 11, 2011 at 8:44 am
Yes, it is working fine if I use the local report.
Thanks for your help.
November 11, 2011 at 8:47 am
So you're all good?
Better output that I was first expecting 😉
November 11, 2011 at 8:57 am
No, its working with localreports but I need to use server reports. 🙁
November 11, 2011 at 8:58 am
Can't help you there!
Sorry.
November 11, 2011 at 2:20 pm
np.
found the solution for one problem. reason I was not able to get value from dynamic controls was that i was loosing them at every postback. So wrote them in Page_Init
Thanks
November 11, 2011 at 4:19 pm
jain1.siddharth (11/11/2011)
np.found the solution for one problem. reason I was not able to get value from dynamic controls was that i was loosing them at every postback. So wrote them in Page_Init
Thanks
Makes sense.
Happy to have almost helped :hehe:!
Viewing 14 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply