Telerik Forums
Reporting Forum
9 answers
766 views

I have Telerik Report that have about 700 images on it. When I generate the pdf, I get the following error message:

Here is the code that I uses.

Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", tk, null);

FileStream fs = new FileStream("d:\\report1.pdf", FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();

However, when I display that in the report viewer on the screen, there is no error. Any idea on how to fix this? I have plenty of diskspace in c:/d: drives.

Thanks.

 

 

System.OutOfMemoryException was unhandled by user code
  Message=Exception of type 'System.OutOfMemoryException' was thrown.
  Source=mscorlib
  StackTrace:
       at System.IO.MemoryStream.set_Capacity(Int32 value)
       at System.IO.MemoryStream.EnsureCapacity(Int32 value)
       at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at Telerik.Reporting.Pdf.IO.PdfWriter.Write(Byte[] bytes)
       at Telerik.Reporting.Pdf.IO.PdfWriter.WriteStream(PdfDictionary value)
       at Telerik.Reporting.Pdf.PdfDictionary.WriteDictionaryStream(PdfWriter writer)
       at Telerik.Reporting.Pdf.PdfDictionary.WriteObject(PdfWriter writer)
       at Telerik.Reporting.Pdf.PdfDocument.Save(Stream stream)
       at Telerik.Reporting.ImageRendering.DocumentPdf.EndDocument()
       at Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.Writing.IWriter.WriteEndDocument()
       at Telerik.Reporting.BaseRendering.PageHandler.Telerik.Reporting.Paging.IPageHandler.EndDocument(Boolean output)
       at Telerik.Reporting.Paging.PagerBase.AddEndDocument(Boolean output)
       at Telerik.Reporting.Paging.PageComposition.PageOverride()
       at Telerik.Reporting.Paging.PagerBase.Page(IPageHandler handler, Report report)
       at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingInfo, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
       at Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback)
       at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
       at Telerik.Reporting.Processing.ReportProcessor.RenderReportStateless(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
       at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo)
       at _ViewReport.rdbGo_Click(Object sender, EventArgs e) in d:\SVN\ROVCatalog\Web\ViewReport.aspx.cs:line 89
       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:

Chavdar
Telerik team
 answered on 01 May 2012
2 answers
238 views
We have a Zebra TLP3842 printer with 300DPI for bar coding. The requirement is to print small bar code labels to stick on things like motherboards. The data printed in the bar code is 22 characters long, i.e. 99X99X9999XXXX9999X9999. With the Zebra printer we can print at .25 in high and 1.75 in wide and the scanner can read this. We cannot get this precision with the Telerik bar codes. The smallest we can get it is 3in wide. This will not fit in the limited space on a mother board. The Zebra software goes to the dot level where Telerik goes to the pt level. Is there a way to improve the Telerik bar codes when using very small dimensions?
Joel Kraft
Top achievements
Rank 2
 answered on 30 Apr 2012
2 answers
128 views
Hi friends

How can I sum up a column values of a table created using the table wizard?

I need to show it at the end of the column .

Thank you
akpaga akpaga
Top achievements
Rank 1
 answered on 30 Apr 2012
1 answer
122 views
We need find support in Colombia, or someone that help us in our proyect. 
Do you recommend someone?
Please is Urgent!!! 
Patrick
Top achievements
Rank 1
 answered on 30 Apr 2012
1 answer
250 views
Hi,
        I'm Samy Currently Working on Telerik Reporting. I'm serializing the Report to a XML and saving to the Database. and deserializing the XML and Show the Report.

        Now I need is In Detailed Section I'm having two Sub Reports and a text box. I have to assign the Footer of the Sub report value to the Textbox in the Main report. how to do this? Please Provide with Sample Code.


      also Can you please guide me How to add water marking in telerik 2011 Q2.

                    Thanks in advance.


Regards,
K.K.Samy
Chavdar
Telerik team
 answered on 30 Apr 2012
8 answers
430 views
I am trying to make a user-friendly message that says "No Results" if the datasource comes back empty. The only problem is that the NeedDatasource event handler even when it is in the ASPX code behind does not allow for any changes to the web page once it fires. The page rendering must happen before that event. Does any one have any suggestions how to implement this "No Results" feature. I don't know why Telerik Reports wouldn't have an EmptyTemplate sort of thing.
Pavan
Top achievements
Rank 1
 answered on 29 Apr 2012
2 answers
81 views
I couldn't check that switching of parameter will create 1016 requests. Now of it it was convinced. I asked myself a question: why loading of lists occurs so long. Why the sqlDataSourceAddresses requests data so many time?
For my case only once suffices, because parameters:
@adrType, @proTypeOwner, @proConId, @proDepId, @proDate, @userId
 don't change.

Thanks.
ADM-IT Denis Pujdak
Top achievements
Rank 1
 answered on 27 Apr 2012
1 answer
131 views
We are showing pdf by pushing pdfbytes array. 
We can able to view Bookmarks section by clicking on Bookmars icon manually as shown in below figure.
But My requirement is to display Bookmarks section in PDF by default. Please Help how to display that section dynamically.

We have used the below code:

<iframe id="ifPDF" src='@Url.Action("GetHtmlReport", "StandardReports")'  class="resultPDF">

 public ActionResult GetHtmlReport()
        {
            byte[] result = null;
            string mimeType = "application/pdf";
            result = popstreatmernt;
            return File(result, mimeType);
        }

 private void GetReportInfo(StandardReportsListViewModel stdReportsFilters)
        {
            try
            {
                RequistionParameters ReqParams = new RequistionParameters();
                RequisitionCheckListbase ReqchkParams = new RequisitionCheckListbase();              
                RequistionChecklistReport reportRequistionChecklist = new RequistionChecklistReport();
                reportRequistionChecklist.ReportInput = ReqchkParams;
                byte[] pdfbytesReport = GetPdfBytes(reportRequistionChecklist);
                popstreatmernt = pdfbytesReport;

            }
            catch { }
        }

public byte[] GetPdfBytes(Report rpt)
        {
            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new                              Telerik.Reporting.Processing.ReportProcessor();
            //set any deviceInfo settings if necessary
            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
            Telerik.Reporting.Processing.RenderingResult result1 = reportProcessor.RenderReport("PDF", rpt, deviceInfo);
            byte[] result = result1.DocumentBytes;
            return result;
        }

Steve
Telerik team
 answered on 27 Apr 2012
1 answer
462 views
Hi,

is there a way to have a fixed number of row in a table even if the datasource have only one rows?

I have an invoice report and the details must have a fixed number of row (10 in this case). If the datasource returns only 2 rows, the other 8 will be blank. In SQL Server reporting service, I achieve it by this query:
DECLARE @Empty TABLE(ROW_NUM INT);
DECLARE @iCount INT
SET @iCount = 1
 
WHILE @iCount<=10
    BEGIN
        INSERT INTO @Empty VALUES(@iCount)
        SET @iCount = @iCount + 1
    END
 
SELECT DETTAGLI.*
    FROM @Empty RF
    LEFT OUTER JOIN (
                    SELECT
                                    ROW_NUMBER() OVER (ORDER BY SEQ) AS RIGA,
                                    FD.SEQ,
                                    UM.CODICE AS UM,
                                    FD.PREZZO,
                                    FD.QUANTITA,
                                    FD.IMPORTO,
                                    FD.DESCRIZIONE,
                                    I.DESCRIZIONE AS DESC_IVA,
                                    I.ALIQUOTA,
                                    I.CODICE AS CODICE_IVA
                                FROM vend.T_FATTURE_DETTAGLIO FD
                                INNER JOIN cont.T_ALIQUOTE_IVA I ON I.ID_ALIQUOTA = FD.ALIQUOTA_IVA_ID
                                INNER JOIN magaz.T_ARTICOLI ART ON ART.ID_ARTICOLO = FD.ARTICOLO_ID
                                LEFT OUTER JOIN anag.T_UM UM ON UM.ID_UM = ART.UM_ID
                                WHERE FATTURA_ID = @prmIDFattura
                    ) DETTAGLI ON DETTAGLI.RIGA = RF.ROW_NUM

But in Telerik Reporting it is not possibel to declare variables into Query. It is an alternate way?

Thanks
Steve
Telerik team
 answered on 27 Apr 2012
1 answer
374 views
Hi All,

In telerik report viewer is it possible to hide/remove entire column according to the flag value.

Eg.
EmpNo   Name   Sal   Desig
111         aaa      100  abc
112         bbb      200  abb
113         ccc       300  baa

My requirement is, if I remove column Sal the Desig column should shift to the left side. In code behind I made the header textbox and field textbox as visible false from code behind. From doing this, only header is removing and shifting to the left side but the field value is not shifting it is taking space.
Is I need to use filters, report parameters for this. Thanks in advance.

Thanks,
Akki
Steve
Telerik team
 answered on 27 Apr 2012
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?