none
Erro na criação de report RRS feed

  • Pergunta

  • Bom dia,

    eu to querendo fazer um relatório sem exibir para o usuário e depois anexar no email e enviar para a x pessoa, eu montei a seguinte rotina abaixo para criação do pdf: 

    string arguments = "";
    			string descrUnidade = this.cboUnidade.SelectedItem.Text;
    			string descrFase = this.cboFase.SelectedItem.Text;
    			string descrPeriodo = this.txtPeriodoInicio.Text + " a " + this.txtPeriodoFim.Text;
    			string reportName = "ReportAnalise.rdlc";
    			arguments = String.Format("{0}|{1}|{2}|{3}", reportName, descrFase, descrUnidade, descrPeriodo);
    
    			string[] argumentsAnalise = arguments.Split('|');			
    
    			this.reportViewer.Reset();
    			this.reportViewer.LocalReport.ReportPath = "Reports/" + reportName;
    			this.reportViewer.LocalReport.DataSources.Clear();
    
    			this.reportViewer.LocalReport.DataSources.Add(new ReportDataSource("InadimplentesViewDataSet", "AnaliseDataSource"));
    			this.reportViewer.LocalReport.SetParameters(new ReportParameter("paramFase", argumentsAnalise[1]));
    			this.reportViewer.LocalReport.SetParameters(new ReportParameter("paramUnidade", argumentsAnalise[2]));
    			this.reportViewer.LocalReport.SetParameters(new ReportParameter("paramPeriodo", argumentsAnalise[3]));
    
    			Warning[] warnings;
    			string[] streamids;
    			string mimeType = "application/pdf";
    			string encoding = "Encoding.Default";
    			string extension = ".pdf";
    
    			string deviceInfo = "<DeviceInfo>" +
    			  "  <OutputFormat>PDF</OutputFormat>" +
    			  "  <PageWidth>21cm</PageWidth>" +
    			  "  <PageHeight>29cm</PageHeight>" +
    			  "  <MarginTop>0.1in</MarginTop>" +
    			  "  <MarginLeft>0in</MarginLeft>" +
    			  "  <MarginRight>0in</MarginRight>" +
    			  "  <MarginBottom>0.1in</MarginBottom>" +
    			  "</DeviceInfo>";
    	
    			byte[] bytes = reportViewer.LocalReport.Render("PDF", deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);
    

     

    nessa última linha, acontece o seguinte erro "An error occurred during local report processing." segue abaixo a stack trace

     

    Microsoft.Reporting.WebForms.LocalProcessingException was unhandled by user code

      Message=An error occurred during local report processing.

      Source=Microsoft.ReportViewer.WebForms

      StackTrace:

           at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)

           at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)

           at Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)

           at Microsoft.Reporting.WebForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)

           at Scob.Web.Default.GerarRelatorioAnaliseTodasUnidades() in C:\Projetos\Sesc\Cobranca\Dev\Source\SCOB\Source\SCOB.WebApp\Default.aspx.cs:line 1425

           at Scob.Web.Default.Button3_Click(Object sender, EventArgs e) in C:\Projetos\Sesc\Cobranca\Dev\Source\SCOB\Source\SCOB.WebApp\Default.aspx.cs:line 1385

           at System.Web.UI.WebControls.Button.OnClick(EventArgs e)

           at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)

           at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

           at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

           at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)

           at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

      InnerException: Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException

           Message=An error has occurred during report processing.

           Source=Microsoft.ReportViewer.Common

           ExceptionLevelHelpLink=http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsProcessingAborted&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=1.0

           SkipTopLevelMessage=false

           StackTrace:

                at Microsoft.ReportingServices.OnDemandProcessing.OnDemandProcessingContext.AbortHelper.ThrowAbortException(String reportUniqueName)

                at Microsoft.ReportingServices.OnDemandProcessing.OnDemandProcessingContext.CheckAndThrowIfAborted()

                at Microsoft.ReportingServices.OnDemandProcessing.RetrievalManager.FetchData(Boolean mergeTran)

                at Microsoft.ReportingServices.OnDemandProcessing.RetrievalManager.PrefetchData(ReportInstance reportInstance, ParameterInfoCollection parameters, Boolean mergeTran)

                at Microsoft.ReportingServices.OnDemandProcessing.Merge.FetchData(ReportInstance reportInstance, Boolean mergeTransaction)

                at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.ProcessOdpReport(Report report, OnDemandMetadata odpMetadataFromSnapshot, ProcessingContext pc, Boolean snapshotProcessing, Boolean reprocessSnapshot, Boolean processUserSortFilterEvent, Boolean processWithCachedData, ErrorContext errorContext, DateTime executionTime, IChunkFactory cacheDataChunkFactory, StoreServerParameters storeServerParameters, GlobalIDOwnerCollection globalIDOwnerCollection, SortFilterEventInfoMap oldUserSortInformation, EventInformation newUserSortInformation, String oldUserSortEventSourceUniqueName, ExecutionLogContext executionLogContext, OnDemandProcessingContext& odpContext)

                at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension newRenderer, DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory cacheDataChunkFactory, IChunkFactory yukonCompiledDefinition, Boolean& dataCached)

                at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension newRenderer, DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory yukonCompiledDefinition)

                at Microsoft.Reporting.LocalService.CreateSnapshotAndRender(CatalogItemContextBase itemContext, ReportProcessing repProc, IRenderingExtension renderer, ProcessingContext pc, RenderingContext rc, SubreportCallbackHandler subreportHandler, ParameterInfoCollection parameters, DatasourceCredentialsCollection credentials)

                at Microsoft.Reporting.LocalService.Render(CatalogItemContextBase itemContext, Boolean allowInternalRenderers, ParameterInfoCollection reportParameters, IEnumerable dataSources, DatasourceCredentialsCollection credentials, CreateAndRegisterStream createStreamCallback, ReportRuntimeSetup runtimeSetup)

                at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)

           InnerException: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException

                Message=InadimplentesViewDataSet

                Source=Microsoft.ReportViewer.Common

                ExceptionLevelHelpLink=http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsErrorCreatingDataReader&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=1.0

                SkipTopLevelMessage=false

                StackTrace:

                     at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSet.RunDataSetQuery()

                     at Microsoft.ReportingServices.OnDemandProcessing.TablixProcessing.RuntimeOnDemandDataSet.Process()

                     at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSet.ProcessConcurrent(Object threadSet)

                InnerException: 

    se alguém puder me ajudar, eu agradeço desde já...
    flws...
    quinta-feira, 20 de outubro de 2011 14:21

Todas as Respostas