This is a migrated thread and some comments may be shown as answers.

General Question to telerik Reporting

2 Answers 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rene
Top achievements
Rank 1
Rene asked on 07 Aug 2017, 09:01 AM

Hi,

before we start to develope a new app one or two questions to telerik reporting.

As i can see the "TRDX-File" is a xml-Struct. So it should be possible to creat a report on the fly by writting a
txt-file an name it to trdx?! Including a csv-Datasource?

And with the Report Viewer it should be possible to print the report in a pdf File with correct sizing like 15cm width
and 7cm height? So i can send the pdf to a windows label-printer??

 

Thanks a lot
Regards RENE

2 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 09 Aug 2017, 12:29 PM
Hi Rene,

Reports definition is quite complex and it is not recommended to create it on the fly as it might lead to the errors like the one we discussed in the support ticket #1123920 Error after saving Report.
If there is a need to create reports programmatically check out Programmatic Control of Reports section.

To set the page size of the report, you can use PaperKind and PaperSize properties in report's PageSettings options.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rene
Top achievements
Rank 1
answered on 09 Aug 2017, 12:32 PM

Hi,

i think it's not so dificult. I have to create a file like this:

<?xml version="1.0" encoding="utf-8"?>
<Report DataSourceName="csvDataSource1" Width="104mm" UnitOfMeasure="Mm" Name="Report1" SnapGridSize="0.1cm" xmlns="http://schemas.telerik.com/reporting/2012/4.2">
  <DataSources>
    <CsvDataSource RecordSeparators=" " FieldSeparators=",}" HasHeaders="True" Name="csvDataSource1">
      <Source>
        <Uri Path="file://goldab/pcdaten/test.csv" />
      </Source>
      <Columns>
        <DataColumn Name="sku" />
        <DataColumn Name="Name" />
        <DataColumn Name="Bild" />
      </Columns>
    </CsvDataSource>
  </DataSources>
  <Items>
    <DetailSection Height="60mm" Name="detailSection1">
      <Items>
        <Barcode Width="54mm" Height="21.0000019073486mm" Left="36.9999974767368mm" Top="4.99999747673678mm" Value="= Fields.sku" Stretch="True" Name="barcode1">
          <Encoder>
            <EAN128Encoder />
          </Encoder>
        </Barcode>
        <PictureBox Width="25.9999949534736mm" Height="25.9999989906947mm" Left="4.99999949534736mm" Top="4.99999747673678mm" Name="pictureBox1">
          <Bindings>
            <Binding Path="Value" Expression="= Fields.Bild" />
          </Bindings>
        </PictureBox>
        <TextBox Width="48.9999954581262mm" Height="18.9999984860421mm" Left="4.99999949534736mm" Top="34.9999984860421mm" Value="= Fields.Name" Name="textBox1" />
      </Items>
    </DetailSection>
  </Items>
  <PageSettings PaperKind="Custom" PaperSize="106mm, 60mm" Landscape="False" ColumnCount="1" ColumnSpacing="0cm" ContinuousPaper="False">
    <Margins>
      <MarginsU Left="1mm" Right="1mm" Top="1mm" Bottom="1mm" />
    </Margins>
  </PageSettings>
  <StyleSheet>
    <StyleRule>
      <Style>
        <Padding Left="2pt" Right="2pt" />
      </Style>
      <Selectors>
        <TypeSelector Type="TextItemBase" />
        <TypeSelector Type="HtmlTextBox" />
      </Selectors>
    </StyleRule>
  </StyleSheet>
</Report>

 

The dynamic Parameter has to be set correctly, but the rest is static.

Thanks a lot

RENE

Tags
General Discussions
Asked by
Rene
Top achievements
Rank 1
Answers by
Katia
Telerik team
Rene
Top achievements
Rank 1
Share this question
or