|
go to run and open IIS manager by typing inetmgr
in that
go to Application > DefulatAppPool > right click and go to properties
In properties > go to identity tab and change predefiend to Local System
|
|
|
|
|
Hi All,
I am using Asp.Net 2.0 with C#, Crystal Reports (VS 2005). I am trying to open a report by passing 4 parameters but it gives an error called "Object reference not set to an instance of an object.". While I debug, I did not get err at any line. It goes smooth but finally it gives an error. Can you guide me?. Here is my code.
crvSTT.RefreshReport();
ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(Server.MapPath("Reports/STTCertificateAnnual1.rpt"));
ParameterFields paramFields = new ParameterFields();
ParameterField pfYear = new ParameterField();
ParameterField pfBACode = new ParameterField();
ParameterField pfFromClientCode = new ParameterField();
ParameterField pfToClientCode = new ParameterField();
pfBACode.ParameterFieldName = "pBACode";
ParameterDiscreteValue pdvBACode;
pdvBACode = new ParameterDiscreteValue();
pdvBACode.Value = strUserId;
pfBACode.CurrentValues.Add(pdvBACode);
paramFields.Add(pfBACode);
pfFromClientCode.ParameterFieldName = "pFromClientCode";
ParameterDiscreteValue pdvFromClientCode;
pdvFromClientCode = new ParameterDiscreteValue();
pdvFromClientCode.Value = txtFromCC.Text;
pfFromClientCode.CurrentValues.Add(pdvFromClientCode);
paramFields.Add(pfFromClientCode);
pfToClientCode.ParameterFieldName = "pToClientCode";
ParameterDiscreteValue pdvToClientCode;
pdvToClientCode = new ParameterDiscreteValue();
pdvToClientCode.Value = txtToCC.Text;
pfToClientCode.CurrentValues.Add(pdvToClientCode);
paramFields.Add(pfToClientCode);
pfYear.ParameterFieldName = "pYear";
ParameterDiscreteValue pdvYear;
pdvYear = new ParameterDiscreteValue();
pdvYear.Value = "Current";
pfYear.CurrentValues.Add(pdvYear);
paramFields.Add(pfYear);
crvSTT.ParameterFieldInfo = paramFields;
crvSTT.ReportSource = rptDoc;
crvSTT.DataBind();
Thanks in Adv Balasubramanian K.
|
|
|
|
|
What is the error that you get at the end when you step through the code?
|
|
|
|
|
"Object reference not set to an instance of an object." is the error I got at my page by came through all the steps of my codes. Balasubramanian K.
|
|
|
|
|
During runtime check if rptDoc holds a value. May be rptDoc.Load(Server.MapPath("Reports/STTCertificateAnnual1.rpt")); returns null.
|
|
|
|
|
"Expression has been evaluated and has no value" is the value I am getting at rptDoc.Load(Server.MapPath("Reports/STTCertificateAnnual1.rpt"));
But the report is available in proper place. What I have to do to solve this?Balasubramanian K.
|
|
|
|
|
If the Reports folder is available in the application root then try
rptDoc.Load("~/Reports/STTCertificateAnnual1.rpt");
HTH!
|
|
|
|
|
This line throws error as "Load Report Failed" Balasubramanian K.
|
|
|
|
|
What is the value you get when you try Server.MapPath("Reports/STTCertificateAnnual1.rpt") in the immediate window?
|
|
|
|
|
"Expression has been evaluated and has no value"
is the value I am getting at immediate window of rptDoc.Load(Server.MapPath("Reports/STTCertificateAnnual1.rpt"));Balasubramanian K.
|
|
|
|
|
Check the value of "rptDoc.IsLoaded " when using the original code rptDoc.Load(Server.MapPath("Reports/STTCertificateAnnual1.rpt"));
|
|
|
|
|
It returns true.
I am getting the business objects' symbols(Export, print, Page nagivator, etc.) also at my page followed by my error.Balasubramanian K.
|
|
|
|
|
In that case, I've lead you in the wrong direction. The report document is not the cause of the error. Sorry.
Check the parms collection for values. Also check if the no of params you are passing matches what the report is expecting.
Other than that, I've no clues to what is going wrong.
|
|
|
|
|
Actually, I pass 4 parameters only. If I pass the same into report directly, I can able to view the report. Through coding, I am trapped. However, you have spent your time for me. Thanks a lot. Balasubramanian K.
|
|
|
|
|
hii all i want that my page and the values inside it gets automatically refreshed and updated
after particular time interval.how could i do this.for example in live cricket score the page automatically gets updated in 5 mins.plz guide....
|
|
|
|
|
|
|
Hello,
I am using Microsoft Visual Studio 2008. I am creating one website using ASP.net with C#.
I have taken one GridView control. In that I am adding 2 columns & bind them to the mysql database.
When mouse cursor moves to the records in the gridview then records turn in to hyperlink record. I do this thr' following code
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline'";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
My problem is i want when we click on the specific record/row then one columns that record should get display in TextBox & next columns selected record get display in DropDownList contrl.
So how can i achieve it?
Thanks in advance
Nikesh
|
|
|
|
|
I've not done this in VS 2008 / .NET 3.x. so some tinkering might be needed.
Check if you can associate a command name and a command event to the column, just try playing around with the item template. If you can then use it to raise the command event and invoke the edit mode for that row and take it from there.
|
|
|
|
|
Hello to All,
Actually I want to know that what is the procedure of Auto Generate Mail or SMS Delivery Message.
and
Secondly I want to Know that How Can I redirect my site to another site (While my site generate the error LIKE : Page not found or Site is going down.).
ThanksIf you can think then I Can.
|
|
|
|
|
you can use triggers to generate mails automatically.
to redirect to other site jst give
Response.Redirect(url)...
|
|
|
|
|
Thanks for responsing
I think Response.Redirect(URL) is for redirecting the page when it's working fine.
But I want redirect in another site when my Site not opening.
secondly
Can u give me any help for how to use triggerIf you can think then I Can.
|
|
|
|
|
you can redirect to new site using response.redirect and what exactly you want i dont get you.
for trigger just google it.there is lot of matter about trigger....
|
|
|
|
|
if my site is under construction then i want to use my another site to use at this url. If you can think then I Can.
|
|
|
|
|
Hello,
I have updated the post so please kindly look at the next one. Many thanks
|
|
|
|