Telerik Forums
Reporting Forum
1 answer
339 views
I have a fairly simple scenario that hopefully someone else has encountered and knows how to solve.

In a report, I have a pretty normal table of fields that show information about a tutoring session.  Under this, I have a field that shows a note that was entered by the session's teacher, and then under that I have two more subreports.

If the note is empty, I make the textbox invisible, however the location of the other controls (i.e. the sub reports below the note field) is not relative / dynamic, so when the note field is not visible, there's a whitespace gap in its place that I would like to get rid of.

Is there a way, without having to programmatically alter the location of every other control on the report, to accomplish what I want?

Thanks!
IvanY
Telerik team
 answered on 15 Aug 2012
1 answer
141 views
Hi,

I have a subreport within a table row to display subrecords of the current row (see image1). The problem is that the row does not grow with the contents of the subreport. Is this possible?

Thanks in advance
IvanY
Telerik team
 answered on 15 Aug 2012
1 answer
376 views
I apologize if I put this in the wrong place or if it has been answered already. ;-)
I have this error:
  • An error occurred during local report processing.
    • The definition of the report 'Reports\RentalPriceByJobAll.rdlc' is invalid.
      • The report definition is not valid. Details: Data at the root level is invalid. Line 1, position 1.
Visual Studio 2010, MSSQL 2008R2 but original database was developed with 2005. Report Viewer 10.0.0.0
Site server - Windows 2k3
 Let me know if you need more info. 

And thank you in advance!

Erica
Peter
Telerik team
 answered on 15 Aug 2012
1 answer
75 views
I appreciate that you can catch an error raised by a report in a viewer but can you catch an error raised by a report within a reportbook displayed in a viewer?

Paul
Top achievements
Rank 1
 answered on 14 Aug 2012
1 answer
294 views
Hello All,

We have a bunch of reports that we export as PDF and they work well.

We export one of those reports to Excel and when we open the file in Excel is informs us there was an error

Repaired Records: Format from /xl/styles.xml part (Styles)

The report is not complex, but it does have a graphic on the top of the page.

any suggestions ?

thanks
Mark


IvanY
Telerik team
 answered on 14 Aug 2012
1 answer
102 views
We have a text box in a report that stores an address. It displays properly in Report Viewer but when it exports to a PDF it no longer has the third line of the address.

Any sugestions would be appreciated. Thanks.

Erin
IvanY
Telerik team
 answered on 14 Aug 2012
1 answer
98 views
Hello,

I am trying to create a report with 2 crosstabs. The report itself has 2 SqlDataSources, but is not binded to them. My goal was to bind the each crosstab to its own datasource. The SqlDataSources have the same set of parameters, but one returns counts, the other returns percentages.

The problem I am having is that when I add the second crosstab to the report, I get a runtime error in the viewer of 'Object not found.' I get the error regardless of wether or not the second crosstab is bound to a data source. In fact, I get the error even if I delete the SqlDataSources on the report.

is it possible to have more than one crosstab on a report?

-Ed
Hrisi
Telerik team
 answered on 14 Aug 2012
1 answer
224 views

I have recently upgraded to 2012 Q2, from 2008 Q3, and now none of textboxes or pictureboxes that utilize the =FIELDS collection have anything in them, and all this worked fine with the earlier version.  Below is the definition of the page, and the method that utilizes/manipulates the data.  The only thing that appears on the page is the current date. 

Anyone have ANY idea why the data is not binding?

Thanks,
Rich

Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports Telerik.Reporting
Imports Telerik.Reporting.Drawing
  
Public Class CoverPage
    Inherits Telerik.Reporting.Report
    Friend WithEvents PageHeaderSection1 As Telerik.Reporting.PageHeaderSection
    Friend WithEvents DetailSection1 As Telerik.Reporting.DetailSection
    Private WithEvents pictureBox1 As Telerik.Reporting.PictureBox
    Private WithEvents textBox1 As Telerik.Reporting.TextBox
    Private WithEvents textBox8 As Telerik.Reporting.TextBox
    Private WithEvents textBox9 As Telerik.Reporting.TextBox
    Private WithEvents textBox10 As Telerik.Reporting.TextBox
    Private WithEvents textBox2 As Telerik.Reporting.TextBox
    Friend WithEvents PageFooterSection1 As Telerik.Reporting.PageFooterSection
  
    Public Sub New()
        InitializeComponent()
  
    End Sub
  
    'NOTE: The following procedure is required by the telerik Reporting Designer
    'It can be modified using the telerik Reporting Designer.  
    'Do not modify it using the code editor.
    Private Sub InitializeComponent()
        Me.PageHeaderSection1 = New Telerik.Reporting.PageHeaderSection()
        Me.pictureBox1 = New Telerik.Reporting.PictureBox()
        Me.textBox1 = New Telerik.Reporting.TextBox()
        Me.textBox8 = New Telerik.Reporting.TextBox()
        Me.textBox9 = New Telerik.Reporting.TextBox()
        Me.textBox10 = New Telerik.Reporting.TextBox()
        Me.textBox2 = New Telerik.Reporting.TextBox()
        Me.DetailSection1 = New Telerik.Reporting.DetailSection()
        Me.PageFooterSection1 = New Telerik.Reporting.PageFooterSection()
        CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
        '
        'PageHeaderSection1
        '
        Me.PageHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(8.7895841598510742R)
        Me.PageHeaderSection1.Items.AddRange(New Telerik.Reporting.ReportItemBase() {Me.pictureBox1, Me.textBox1, Me.textBox8, Me.textBox9, Me.textBox10, Me.textBox2})
        Me.PageHeaderSection1.Name = "PageHeaderSection1"
        '
        'pictureBox1
        '
        Me.pictureBox1.Location = New Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.010456085205078125R), Telerik.Reporting.Drawing.Unit.Inch(0.010456006042659283R))
        Me.pictureBox1.MimeType = ""
        Me.pictureBox1.Name = "pictureBox1"
        Me.pictureBox1.Size = New Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(2.9791271686553955R), Telerik.Reporting.Drawing.Unit.Inch(1.9791272878646851R))
        Me.pictureBox1.Sizing = Telerik.Reporting.Drawing.ImageSizeMode.ScaleProportional
        Me.pictureBox1.Value = "=Fields.LOGO"
        '
        'textBox1
        '
        Me.textBox1.Location = New Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.0062500634230673313R), Telerik.Reporting.Drawing.Unit.Inch(2.5R))
        Me.textBox1.Name = "textBox1"
        Me.textBox1.Size = New Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(6.4728379249572754R), Telerik.Reporting.Drawing.Unit.Inch(0.38958358764648438R))
        Me.textBox1.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(20.0R)
        Me.textBox1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center
        Me.textBox1.Value = "=Fields.JOB_NAME"
        '
        'textBox8
        '
        Me.textBox8.Format = "{0:d}"
        Me.textBox8.Location = New Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.0R), Telerik.Reporting.Drawing.Unit.Inch(3.1314079761505127R))
        Me.textBox8.Name = "textBox8"
        Me.textBox8.Size = New Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(6.4790878295898437R), Telerik.Reporting.Drawing.Unit.Inch(0.20000004768371582R))
        Me.textBox8.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center
        Me.textBox8.Value = "=Now()"
        '
        'textBox9
        '
        Me.textBox9.Location = New Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.0R), Telerik.Reporting.Drawing.Unit.Inch(2.9104957580566406R))
        Me.textBox9.Name = "textBox9"
        Me.textBox9.Size = New Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(6.4790878295898437R), Telerik.Reporting.Drawing.Unit.Inch(0.20000004768371582R))
        Me.textBox9.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center
        Me.textBox9.Value = "=Fields.PROJECT_NUMBER"
        '
        'textBox10
        '
        Me.textBox10.Location = New Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.5104167461395264R), Telerik.Reporting.Drawing.Unit.Inch(0.010456045158207417R))
        Me.textBox10.Name = "textBox10"
        Me.textBox10.Size = New Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(2.9686708450317383R), Telerik.Reporting.Drawing.Unit.Inch(0.20000004768371582R))
        Me.textBox10.Value = "=Fields.ENTIRE_ADDR"
        '
        'textBox2
        '
        Me.textBox2.Location = New Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.031368255615234375R), Telerik.Reporting.Drawing.Unit.Inch(6.0208334922790527R))
        Me.textBox2.Name = "textBox2"
        Me.textBox2.Size = New Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(6.4686317443847656R), Telerik.Reporting.Drawing.Unit.Inch(2.7687110900878906R))
        Me.textBox2.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom
        Me.textBox2.Value = "=Fields.COVER_PAGE_TEXT"
        '
        'DetailSection1
        '
        Me.DetailSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(0.0520833320915699R)
        Me.DetailSection1.Name = "DetailSection1"
        '
        'PageFooterSection1
        '
        Me.PageFooterSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(0.0520833320915699R)
        Me.PageFooterSection1.Name = "PageFooterSection1"
        '
        'CoverPage
        '
        Me.Items.AddRange(New Telerik.Reporting.ReportItemBase() {Me.PageHeaderSection1, Me.DetailSection1, Me.PageFooterSection1})
        Me.Name = "CoverPage"
        Me.PageSettings.Landscape = False
        Me.PageSettings.Margins.Bottom = Telerik.Reporting.Drawing.Unit.Inch(1.0R)
        Me.PageSettings.Margins.Left = Telerik.Reporting.Drawing.Unit.Inch(1.0R)
        Me.PageSettings.Margins.Right = Telerik.Reporting.Drawing.Unit.Inch(1.0R)
        Me.PageSettings.Margins.Top = Telerik.Reporting.Drawing.Unit.Inch(1.0R)
        Me.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Letter
        Me.Style.BackgroundColor = System.Drawing.Color.White
        Me.Width = Telerik.Reporting.Drawing.Unit.Inch(6.5R)
        CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
  
    End Sub
End Class
  
  
   Private Sub CreateCoverPage(ByVal submittalID As Decimal, ByVal doc As PDFDocument)
  
        Dim dtCover As doSubmittal.CoverPageDataTable
        Using rpt As New boSubmittal
            dtCover = rpt.CoverPage_GetBySubmittalID(submittalID)
        End Using
        Dim dr As doSubmittal.CoverPageRow = dtCover(0)
  
        dr.ENTIRE_ADDR = String.Empty
        If Not dr.IsREP_NAMENull Then dr.ENTIRE_ADDR &= dr.REP_NAME & vbCrLf
        If Not dr.IsADDR_LINE_1Null AndAlso Not String.IsNullOrEmpty(dr.ADDR_LINE_1.Trim) Then dr.ENTIRE_ADDR &= dr.ADDR_LINE_1 & vbCrLf
        If Not dr.IsADDR_LINE_2Null AndAlso Not String.IsNullOrEmpty(dr.ADDR_LINE_2.Trim) Then dr.ENTIRE_ADDR &= dr.ADDR_LINE_2 & vbCrLf
        If Not dr.IsADDR_LINE_3Null AndAlso Not String.IsNullOrEmpty(dr.ADDR_LINE_3.Trim) Then dr.ENTIRE_ADDR &= dr.ADDR_LINE_3 & vbCrLf
        If Not dr.IsCITYSTATEZIPNull Then dr.ENTIRE_ADDR &= dr.CITYSTATEZIP & vbCrLf
        If Not dr.IsPHONE_NUMBERNull Then dr.ENTIRE_ADDR &= "Phone: " & dr.PHONE_NUMBER & vbCrLf
        If Not dr.IsFAX_NUMBERNull Then dr.ENTIRE_ADDR &= "Fax: " & dr.FAX_NUMBER & vbCrLf
        If Not dr.IsREP_CONTACT_NAMENull Then dr.ENTIRE_ADDR &= "Contact: " & dr.REP_CONTACT_NAME & vbCrLf
  
        If Not dr.IsPRINT_CONTACTS_FLAGNull Then
            dr.ALL_CONTACTS = String.Empty
            Dim contacts = GetContacts(submittalID)
  
            dr.ALL_CONTACTS &= vbCrLf & "Submitted To: " & vbCrLf & contacts
  
        End If
  
        If Not dr.IsVERSION_NUMBERNull Then
            dr.PROJECT_NUMBER = dr.PROJECT_NUMBER & "-" & dr.VERSION_NUMBER
        End If
  
        Dim cvr As New CoverPage
        Dim mimType As String = String.Empty
        Dim extension As String = String.Empty
        Dim encoding As Encoding = Nothing
  
        Dim rptProcessor As New Telerik.Reporting.Processing.ReportProcessor()
  
        Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
        instanceReportSource.ReportDocument = cvr
        Dim result As Telerik.Reporting.Processing.RenderingResult = rptProcessor.RenderReport("PDF", instanceReportSource, Nothing)
  
        Dim fileName As String = result.DocumentName & ".pdf"
        Dim buffer As Byte() = result.DocumentBytes
  
        PDFFileEx.SerialNumber = _serialNumber
        Dim mctiFile As PDFFileEx = PDFFileEx.FromStream(New MemoryStream(buffer))
  
        Try
            ' extract the content 
            Dim ic As PDFImportedContent() = mctiFile.ExtractPagesContent()
  
            ' create the new document
            Dim pic As PDFImportedContent
            For Each pic In ic
                ' draw the imported content on the new page
                Dim page1 As PDFPage = doc.AddPage()
                page1.Canvas.DrawImportedContent(pic, 0, 0, page1.Width, page1.Height)
            Next
  
        Finally
            mctiFile.Close()
            mctiFile.Dispose()
            cvr.Dispose()
            dtCover.Dispose()
        End Try
  
  
    End Sub
Peter
Telerik team
 answered on 14 Aug 2012
5 answers
206 views
Hi..
Why does the following have no effect?
 chart.PlotArea.YAxis.Appearance.Color = System.Drawing.Color.Black;


I'm trying to set the X and Y axis to appear in black text.  But they still appear in the default gray'ish color.

any ideas?
thx
Hrisi
Telerik team
 answered on 13 Aug 2012
2 answers
193 views
Language: C#, VS2010
First, I tried to report in a standalone project (WinForms) zu display a preview with ReportViewer and it worked.
Then I added the same files and references to a bigger solution (WinForms also) and called the PreviewDialog like before in the standalone project and I generates also the reportdocument, but this time it prompt me first 3 messages with the caption Error! (Fehler!), but only once during the runtime.

Heres the method that starts the ReportRefresh-Method()

/// <summary>
/// Barcodes generieren und anzeigen. Legt zusätzlich den angezeigten Titel fest und stellt Enabled auf true.
/// </summary>
/// <param name="titel">Anzuzeigender Titel</param>
/// <param name="barcodeItems">Zu erstellende Barcodes</param>
/// <param name="target">ReportViewer, der als Ausgabe verwendet werden soll</param>
public static void DisplayBarcodes(Telerik.ReportViewer.WinForms.ReportViewer target, string titel, IEnumerable<ReportItem> barcodeItems)
        {
            DefaultUserPresentationReport templateOfReport = null;
            InstanceReportSource instance = null;
            bool newReport = false;
 
            if (target.ReportSource != null)
            {
                instance = (target.ReportSource as InstanceReportSource);
                if (instance != null && instance.ReportDocument != null)
                {
                       templateOfReport = instance.ReportDocument as DefaultUserPresentationReport;
                }
            }
            else
            {
                templateOfReport = new DefaultUserPresentationReport();
                newReport = true;
            }
 
            templateOfReport.DocumentName = titel;
 
            //Aufgrund der Performance, werden die Bilder an die tatsächliche Größe angepasst
            // Zielgröße bestimmen
            Size sizeOfItemImage_Pixel = templateOfReport.ThumbnailSize;
 
            // A list with barcodeItems and an image
            List<ReportItem> barcodeListe = barcodeItems.ToList();
 
            // Resize images to preview size
            for (int i = 0; i < barcodeListe.Count; i++)
            {
                if (barcodeListe[i].Bild != null)
                {
                    // wrong size images only!
                    if (barcodeListe[i].Bild.PhysicalDimension.Width != sizeOfItemImage_Pixel.Width || barcodeListe[i].Bild.PhysicalDimension.Height != sizeOfItemImage_Pixel.Height)
                    {
                        var newImageForReport = new Bitmap(barcodeListe[i].Bild, sizeOfItemImage_Pixel);
 
                        // free old ram space!
                        barcodeListe[i].Bild.Dispose();
                        barcodeListe[i].Bild = null;
 
                        barcodeListe[i].Bild = newImageForReport;
                    }
                }
            }
 
            target.Enabled = true;
            // set report title
            templateOfReport.Title = titel;
 
            // set source of template report to items
            templateOfReport.SetItemsToPrint(barcodeListe);
 
            if (newReport)
            {
                target.ReportSource = new InstanceReportSource() { ReportDocument = templateOfReport };
            }
            else
            {
                target.ReportSource = instance;
            }
 
            // render start!
            fromMethod = true;
 
            // ! During this step suddenly 3 messages prompt
            target.RefreshReport();
 
            fromMethod = false;
        }

Number
#1) Telerik.Reporting.HTMLRendering2.HtmlReport.resources
#2) Telerik.Reporting.HTMLRendering2.HtmlReportInteractive.resources 
#3) Telerik.Reporting.HTMLRendering2.MHTMLReport.resources

The type Telerik.Reporting.HTMLRendering2.HtmlReport.resources could not be solved
Sender: MyApplication.host.exe
No context avaible

The refrerences the first project needed were:
Telerik.Reporting
and Telerik.ReportViewer

Note:
No Error-Event is firing before these messages are shown and I only want to display the document report and export to pdf.
So it does not have any connection the a Telerik.Reporting.HtmlRendering2 namespace.

Does someone had also this problem and a solution, and why are these message shown in the second, but not in the first standalone project?

Once again, there are all the same files and references in both projects.

I added the messages to one image as attach-files.

System: Windows 7, VS2010, C#

Solution structure second projects:

Solution Folder
   First Start Project X
        App.config
   Project Y
   Project Z ...
   Report Project
        Refrences to Telerik.Reporting, Telerik.ReportViewer.WinForms (both Version: 6.1.12.611, Description: Q2 2012)
        ProjectFolders with ReportPreviewForm
Hrisi
Telerik team
 answered on 13 Aug 2012
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?