My report runs fine until I added a new field ("TradeDate") to the datasource. when run the report, I got the following error:
-------------------------------------------
Error 1 The Value expression for the textbox ‘textbox68’ refers to the field ‘TradeDate’. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope. C:\Pro1\Allocation.rdlc 1
-------------------------------------------
I can see the "TradeDate" on the Datasource list on the left pane after i built the project. But it seems rdlc file still catch the previous datasource, not the current one..
I want to generate PDF programmatically using c# in Web application.but when i built my code getting an exception as " An error occurred during local report processing" near underlined font.
Here is the code.
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
ReportViewer1.LocalReport.SetParameters(param);
ReportViewer1.LocalReport.DataSources.Clear();
ReportDataSource obj1 = new ReportDataSource("NewZealandCollegedatasetTableAdapters.RptSelectUserDetailsTableAdapter", ObjectDataSource1);
// ReportDataSource obj2 = new ReportDataSource("NewZealandCollegedatasetTableAdapters.RptSelectUserAddressDetailsTableAdapter", ObjectDataSource2);
ReportViewer1.LocalReport.DataSources.Add(obj1);
// ReportViewer1.LocalReport.DataSources.Add(obj2);
ReportViewer1.DataBind();
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ServerReport.Refresh();
#region Generate PDF
string reportType = "PDF";
string mimeType;
string encoding;
string fileNameExtension;
//The DeviceInfo settings should be changed based on the reportType
2.Type “Cd windows\assembly\gac_msil\Microsoft.ReportViewer.pro*” and press enter
3.List the directory (type dir and
press enter)
4.You will see the two versions 8 and 9
5.Just type cd 9*
6.Then type copy * c:\
file will be copied in you root directory of C drive
Add the Reference in to your BIN folder and put it on Server...
This Works.. Spent almost 3 days of my life. to just figure out what the heck the prob was. but cant assure that this solution
works in all the server..
yes, peice of advice... all ReportViewer 8.0 is for the Asp.Net 2.0 application and Version 9.0 is not Asp.net 3.5
wgg117
Member
2 Points
66 Posts
An error occurred during local report processing
Mar 24, 2008 07:44 PM|LINK
My report runs fine until I added a new field ("TradeDate") to the datasource. when run the report, I got the following error:
-------------------------------------------
Error 1 The Value expression for the textbox ‘textbox68’ refers to the field ‘TradeDate’. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope. C:\Pro1\Allocation.rdlc 1
-------------------------------------------
I can see the "TradeDate" on the Datasource list on the left pane after i built the project. But it seems rdlc file still catch the previous datasource, not the current one..
Thanks
bullpit
All-Star
21838 Points
4822 Posts
Re: An error occurred during local report processing
Mar 24, 2008 08:03 PM|LINK
Not sure if this will help but try removing the datasource from the Report menu and then adding it again.
Max
Let Me Google That For You!
wgg117
Member
2 Points
66 Posts
Re: An error occurred during local report processing
Mar 24, 2008 08:24 PM|LINK
ok, I created a new RDLC file for my report page. It is working fine now.
Before that, I tried many ways, deleted temp files, restartd the web server, they are not helping..
Thanks
wgg117
Member
2 Points
66 Posts
Re: An error occurred during local report processing
Mar 24, 2008 08:25 PM|LINK
ok, I created a new RDLC file for my report page. It is working fine now.
Before that, I tried many ways, deleted temp files, restartd the web server, they are not helping..
Thanks
bullpit
All-Star
21838 Points
4822 Posts
Re: An error occurred during local report processing
Mar 24, 2008 08:27 PM|LINK
Next time try what I suggested and see if that helps...
Max
Let Me Google That For You!
Madhumitha
Member
6 Points
5 Posts
Re: An error occurred during local report processing
Feb 03, 2009 10:29 AM|LINK
Hi,
I want to generate PDF programmatically using c# in Web application.but when i built my code getting an exception as " An error occurred during local report processing" near underlined font.
Here is the code.
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
ReportViewer1.LocalReport.SetParameters(param);
ReportViewer1.LocalReport.DataSources.Clear();
ReportDataSource obj1 = new ReportDataSource("NewZealandCollegedatasetTableAdapters.RptSelectUserDetailsTableAdapter", ObjectDataSource1);
// ReportDataSource obj2 = new ReportDataSource("NewZealandCollegedatasetTableAdapters.RptSelectUserAddressDetailsTableAdapter", ObjectDataSource2);
ReportViewer1.LocalReport.DataSources.Add(obj1);
// ReportViewer1.LocalReport.DataSources.Add(obj2);
ReportViewer1.DataBind();
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ServerReport.Refresh();
#region Generate PDF
string reportType = "PDF";
string mimeType;
string encoding;
string fileNameExtension;
//The DeviceInfo settings should be changed based on the reportType
//http://msdn2.microsoft.com/en-us/library/ms155397.aspx
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>PDF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>1in</MarginLeft>" +
" <MarginRight>1in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
/// ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
//Render the report
//ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/NewZealandCollege.rdlc");
renderedBytes = ReportViewer1.LocalReport.Render(
reportType,
deviceInfo,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
//Clear the response stream and write the bytes to the outputstream
//Set content-disposition to "attachment" so that user is prompted to take an action
//on the file (open or save)
Response.Clear();
Response.ContentType = mimeType;
string filepath = Server.MapPath("Output.pdf");
// Response.AddHeader("content-disposition", "attachment; filename=foo." + fileNameExtension);
System.IO.FileStream fs = new System.IO.FileStream(filepath, System.IO.FileMode.Create);
fs.Write(renderedBytes, 0, renderedBytes.Length);
fs.Close();
// Response.BinaryWrite(renderedBytes);
//Send an Email after pdf is generated
SendMail(filepath);
System.IO.FileInfo fo = new System.IO.FileInfo(filepath);
if (fo.Exists)
{
fo.Delete();
}
Response.End();
#endregion
Can anyone tell me what mistake i have done.Its very urgent.
Thanks in advance
PDF asp.net 2.0 date format reportviewer rdlc local report asp.net 2.0 AnnounceOrGetKey Reporting Services symmetric key setup
dvodonnell
Member
2 Points
1 Post
Re: An error occurred during local report processing
Feb 27, 2009 02:49 PM|LINK
What's the exception being generated?
Add a new handler for the OnError event of the reportviewer object to get this information.
shijobaby500
Member
54 Points
28 Posts
Re: An error occurred during local report processing
Dec 13, 2009 01:40 PM|LINK
http://crystalrepterrinfo.blogspot.com/2009/12/error-occurred-during-client.html
kinturaj
Member
2 Points
3 Posts
Re: An error occurred during local report processing
May 21, 2010 10:09 PM|LINK
How to copy Microsoft.ReportViewer.ProcessingObjectModel.dll
First of all click on it to download Microsoft Report Viewer Redistributable 2008 http://www.microsoft.com/downloads/details.aspx?FamilyID=CC96C246-61E5-4D9E-BB5F-416D75A1B9EF&displaylang=en
1. Then open dos command prompt
2. Type “Cd windows\assembly\gac_msil\Microsoft.ReportViewer.pro*” and press enter
3. List the directory (type dir and press enter)
4. You will see the two versions 8 and 9
5. Just type cd 9*
6. Then type copy * c:\
file will be copied in you root directory of C drive
Add the Reference in to your BIN folder and put it on Server...
This Works.. Spent almost 3 days of my life. to just figure out what the heck the prob was. but cant assure that this solution works in all the server..
yes, peice of advice... all ReportViewer 8.0 is for the Asp.Net 2.0 application and Version 9.0 is not Asp.net 3.5
dinadonna
Member
5 Points
16 Posts
Re: An error occurred during local report processing
Oct 13, 2010 09:46 AM|LINK
Hi friends ,
I 've experineced the same error when I'm trying to export the rdlc file into PDF format
here is my code
public List<Item> GetData() { return Item.GetItems(); } void RenderReport() { LocalReport local = new LocalReport(); local.ReportPath = Server.MapPath("~/testreport.rdlc"); List<Item> data = GetData(); ReportDataSource src = new ReportDataSource("mydata", data); local.DataSources.Add(src); string reportType="PDF"; string mimeType; string encoding; string fileNameExtension; string deviceInfo = "<DeviceInfo>" + " <OutputFormat>PDF</OutputFormat>" + " <PageWidth>8.5in</PageWidth>" + " <PageHeight>11in</PageHeight>" + " <MarginTop>0.5in</MarginTop>" + " <MarginLeft>1in</MarginLeft>" + " <MarginRight>1in</MarginRight>" + " <MarginBottom>0.5in</MarginBottom>" + "</DeviceInfo>"; Warning[] warnings; string[] streams; byte[] renderedBytes; //************************************************************************ //Render the report renderedBytes = local.Render( reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings); //Clear the response stream and write the bytes to the outputstream //Set content-disposition to "attachment" so that user is prompted to take an action //on the file (open or save) Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "attachment; filename=foo." + fileNameExtension); Response.BinaryWrite(renderedBytes); Response.End(); }what is wrong I'm doing here?
thanks in advance.