Telerik Forums
Reporting Forum
2 answers
234 views
Hi there,

I have noticed something extremely odd. It seems like TextBox or is choosing heights in unexpected ways when they are children of a table.
What I have is a loop iterates over some data rows and adds TextBoxes to a table. The reason I am doing this is because by requirements are to build a report based on report configuration data stored in the data base. So a report template would not work for me (as most of your examples are).

So what I have is the following.

private void BuildReport()
{
    Table tbl = new Table();
 
    Unit columnWidth = Unit.Inch(0.5);
    tbl.Body.Columns.AddRange(new TableBodyColumn[] {
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth),
        new TableBodyColumn(columnWidth)
    }.AsEnumerable());
 
    tbl.Style.BorderWidth.Top = new Unit(1D, UnitType.Pixel);
    tbl.Style.BorderWidth.Bottom = new Unit(1D, UnitType.Pixel);
    tbl.Style.BorderWidth.Left = new Unit(1D, UnitType.Pixel);
    tbl.Style.BorderWidth.Right = new Unit(1D, UnitType.Pixel);
 
    tbl.Style.BorderStyle.Top = BorderType.Solid;
    tbl.Style.BorderStyle.Bottom = BorderType.Solid;
    tbl.Style.BorderStyle.Left = BorderType.Solid;
    tbl.Style.BorderStyle.Right = BorderType.Solid;
 
    for (int idx = 0; idx < tbl.Body.Columns.Count; idx++)
    {
        TableGroup group = new TableGroup();
        tbl.ColumnGroups.Add(group);
    }
 
    this.DetailSection.Items.AddRange(new ReportItemBase[] { tbl });
    int rowNumber = 0;
    for (int idx = 0; idx < fieldComps.Count; idx++)
    {
        ModelTableFieldComposition_Flatten field = fieldComps[idx];
        GetLabelRow(field, ds, tbl, ref rowNumber);
    }
}
 
private void GetLabelRow(ModelTableFieldComposition_Flatten field, Table tbl, ref int rowNumber)
{
    TableGroup tableGroupRow = new TableGroup();
 
    tbl.RowGroups.Add(tableGroupRow);
    tbl.Body.Rows.Add(new TableBodyRow(Unit.Inch(0.1D)));
 
    int colIndex = 0;
 
    Telerik.Reporting.TextBox labelTextBox = new TextBox();
    labelTextBox.Name = "labelField";
    labelTextBox.Size = new SizeU(Unit.Inch(0.1), Unit.Inch(0.1));
    labelTextBox.Style.BorderStyle.Bottom = Telerik.Reporting.Drawing.BorderType.Solid;
    labelTextBox.Style.BorderStyle.Left = Telerik.Reporting.Drawing.BorderType.Solid;
    labelTextBox.Style.Font.Name = "Segoe UI";
    labelTextBox.Style.Font.Size = Unit.Point(10);
    labelTextBox.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
 
    labelTextBox.Value = field.DisplayName;
    labelTextBox.Visible = field.FieldLabelVisible;
 
    labelTextBox.Style.BackgroundColor = Color.Wheat;
    labelTextBox.Style.Color = Color.Black;
 
    tbl.Body.SetCellContent(rowNumber, 0, labelTextBox, 0, field.ReportFieldLabelColumnSpan);
    tbl.Items.AddRange(new ReportItemBase[] { labelTextBox });
 
    int columnSpanCounter = field.ReportFieldLabelColumnSpan;
 
    colIndex = field.ReportFieldLabelColumnSpan;
 
    while (columnSpanCounter < 12)
    {
        Telerik.Reporting.TextBox emptyLabelTextBox = new TextBox();
        emptyLabelTextBox.Name = "emptyField";
        emptyLabelTextBox.Size = new SizeU(Unit.Inch(0.1), Unit.Inch(0.1));
        emptyLabelTextBox.Visible = true;
        emptyLabelTextBox.Value = string.Empty;
 
        emptyLabelTextBox.Style.BorderStyle.Bottom = Telerik.Reporting.Drawing.BorderType.Solid;
        emptyLabelTextBox.Style.BorderStyle.Left = Telerik.Reporting.Drawing.BorderType.Solid;
        emptyLabelTextBox.Style.Font.Name = "Segoe UI";
        emptyLabelTextBox.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
 
        tbl.Body.SetCellContent(rowNumber, colIndex, emptyLabelTextBox, 0, 1);
        tbl.Items.AddRange(new ReportItemBase[] { emptyLabelTextBox });
 
        columnSpanCounter++;
        colIndex++;
    }
 
    rowNumber++;
}
Stef
Telerik team
 answered on 27 Sep 2013
3 answers
415 views
I have a silverlight/wcf application that uses Telerik reporting. One of the requirements of the app is to be able to combine multiple reports into a single pdf. In order to do this, I have a custom report service class that inherits from ReportServiceBase. The silverlight app passes a list of report names to the wcf service, which loops through the list and calls the report service's Render("PDF", etc...) method. In order to keep the file size small, I set FontEmbedding to None in the Render call's deviceInfo. Using the DocumentBytes from each RenderingResult, I append each pdf into a single pdf using a third party tool (PDFSharp). The bytes of the single pdf are then sent back to the silverlight side, where they're loaded into a RadPdfViewer, where users can then save the pdf (using the method described here: http://www.telerik.com/community/forums/silverlight/pdfviewer/save-pdf-file.aspx)

All of this works as expected, except that the resulting pdf is using Identity-H font encoding and a TrueType (CID) font. If I create (roughly) the same pdf using another tool (PDFXchange), the resulting pdf has WinAnsiEncoding and a TrueType font (not CID). When viewing the resulting pdfs on an iPad, the Telerik rendered pdf doesn't display italics or bold, whereas the non-Telerik pdf does. The font encoding is the only readily apparent difference between the two pdfs, which leads me to believe that's the issue (Note: The issue still occurs if I just render a single report and don't use the third party tool to merge, so it's not an issue with the third party tool).

Is there a way to change the font encoding used by the Telerik report service Render method? Or any other thoughts as to why an iPad can't display bold/italic fonts in a pdf generated in this manner?
Stef
Telerik team
 answered on 27 Sep 2013
1 answer
266 views
Hi

How can I pass a parameter value from ASP.NET page to a report displayed in a report viewer? Do you have a complete example for this scenario?

Thanx
Saeid Kdaimati
Top achievements
Rank 2
 answered on 27 Sep 2013
0 answers
93 views
i have report with graphAxis , i change angel to 270 , label show if the value is small else if value of x axis report disappear 
i want to fixed width of the label or warped label 
Ahmed
Top achievements
Rank 1
 asked on 26 Sep 2013
7 answers
372 views
I have a list that sometimes has no data but its full height is blank even when it is empty.

I've tried conditional formatting and setting visibility to false when there are no items but still whitespace.

I've tried binding the height of the list to this expression =iif(Fields.PatientCases.Count = 0, ".01in", "1in") but no change.

Any other suggestions?

Thanks,
Don Rule
Nasko
Telerik team
 answered on 26 Sep 2013
1 answer
266 views
I am using dynamic query and pivot in MS SQL stored procedure. when i run this stored procedure it returns me result set. In Reporting, when configure the data source it returns me result set on the Preview Data Source Results BUT nothing comes in Data Explorer window.
On the other side if i use SP without Pivot and Dynamic query it works fine.
Following is the SQL SP.
 
ALTER PROC dbo.GetSeminarReportHeaders
    @DiagnosticFormCode VARCHAR(7)
AS 
    BEGIN 

        SELECT DISTINCT
                DiagnosticFormCode ,
                'Section ' + CONVERT(VARCHAR(50), ds.SectionNumber) + ' - '
                + sst.Name AS Section ,
                QuestionNumber ,
                CorrectAnswer
        INTO    #header
        FROM    dbo.DiagnosticQuestions dq
                INNER JOIN dbo.DiagnosticSections ds ON ds.ID = dq.DiagnosticSectionId
                INNER JOIN dbo.SectionSubjectTypes sst ON sst.ID = ds.SectionTypeId
                INNER JOIN dbo.DiagnosticForms df ON df.ID = ds.DiagnosticFormId
         WHERE   DiagnosticFormCode = @DiagnosticFormCode 

        DECLARE @columns NVARCHAR(MAX) ,
            @query NVARCHAR(MAX)

        SELECT  @columns = COALESCE(@Columns + ',', '')
                + QUOTENAME(questionnumber)
        FROM    ( SELECT DISTINCT
                            QuestionNumber
                  FROM      #header
                ) c
        ORDER BY c.QuestionNumber

        SET @columns = REPLACE(@columns, ',[1]', '[1]')

        SET @query = N'Select distinct DiagnosticFormCode,Section,' + @columns
            + '   
FROM   
(SELECT distinct
DiagnosticFormCode,
Section,
QuestionNumber,
CorrectAnswer
FROM #header AS h
) p
PIVOT
(
max([CorrectAnswer] )
FOR QuestionNumber IN
( ' + @columns + ' )
) AS pvt '

        EXEC sp_executesql @query
--EXEC(@query)
        DROP TABLE #header
    END

Nasko
Telerik team
 answered on 25 Sep 2013
1 answer
187 views
I created a simple report using all defaults other than setting margins to .25
In the designer everything looks good, in preview it is as if I set the page size to postcard or something. When I print it is the same as the preview. I saw a forum post about Win7 Text size and confirmed that mine is set to, smaller - 100%
I attached screen shots of the designer and the preview
Stef
Telerik team
 answered on 25 Sep 2013
10 answers
362 views
I read the help and also some threads here on the forum, and even then, you can run a report type trdx, no user data source SQL Server and such.
Now my question is, fom customize a report data from a SQL Server data source and call the application through some filters.

In short: I have not seen anywhere here on the site of how to call a report that has its data from a data source, the opening of the report doing some filter data and also now enjoying the DataSource application to why my application is WPF Desktop then the DataSource changes from customer to customer.
With this piece of code could run a report from the folder is located.


XAML
                xmlns:tr="http://schemas.telerik.com/wpf" x:Class="RadControlsWpfApp1.MainWindow"
                Title="MainWindow" Height="350" Width="525">
    <Grid>
        <tr:ReportViewer x:Name="reportViewer1"/>
    </Grid>

C#
            var report = new UriReportSource();
            report.Uri = System.IO.Path.Combine(Environment.CurrentDirectory, "Barcodes Report.trdx");
            //report.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumber", "SO43659"));
            this.reportViewer1.ReportSource = report;

And now how to filter?

is possible for a demo or example a video explaining about, we urgently need our system to pass the work with telerik report.
I thank you.


graciously
André
Nasko
Telerik team
 answered on 25 Sep 2013
1 answer
97 views
Hi,

I created a Graph (via Graph Wizard) with Category X Axis.  The Axis labels overlap when the graph has many data points. How can I set an interval for the labels, and is there an auto-format for this?

I find how to do it with Charts but the documentation says Charts is obsolete and no mention on how to do it in Graph.

Thanks!
Stef
Telerik team
 answered on 25 Sep 2013
2 answers
1.5K+ views
Is there a sample anyplace that I can see where the Telerik Reporting control is being used in a Kendo UI application?
Stef
Telerik team
 answered on 25 Sep 2013
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?