Telerik Forums
Reporting Forum
1 answer
166 views
Hi,

  I´ve some dificult to resolv one problem, the cenarius is:

  - I´ve a common header report
  - Detail section, and footer

  On my detail I have some controls anfter I want a sub report to detailing same records and after I have more controls.

  The problem is that the sub report lost the datasource, and on databinding occurs the error.

  My Source:

   Fisrt Report

namespace Eorder_Reporting 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
    using Telerik.Reporting; 
    using Telerik.Reporting.Drawing; 
    using System.Data; 
    using Report.dal; 
    using System.Text; 
     
 
    /// <summary> 
    /// Summary description for ReportConsultaPedido. 
    /// </summary> 
    public partial class ReportConsultaPedido : Report 
    { 
        public ReportConsultaPedido() 
        { 
            /// <summary> 
            /// Required for telerik Reporting designer support 
            /// </summary> 
            InitializeComponent(); 
 
            // 
            // TODO: Add any constructor code after InitializeComponent call 
            // 
 
            this.DataSource = null
            this.subReport1.ReportSource = null
 
        } 
        string _strVarIdPedido; 
        public string IdPedidoDetalheConsulta 
        { 
            get 
            { 
                return (_strVarIdPedido); 
            } 
            set 
            { 
                _strVarIdPedido = value; 
            } 
        } 
 
        private void ReportConsultaPedido_NeedDataSource(object sender, System.EventArgs e) 
        { 
            dal clsDal = new dal(); 
 
            StringBuilder strSQL = new StringBuilder(); 
 
            strSQL.Append("SELECT     CP_PEDIDO_V.ID_PEDIDO, CP_PEDIDO_V.ID_USUARIO, CP_PEDIDO_V.NR_ORDEM_COMPRA, CP_PEDIDO_V.DT_PEDIDO, "); 
            strSQL.Append("          CP_PEDIDO_V.DT_ENTREGA, CP_PEDIDO_V.TS_INCLUSAO, CP_PEDIDO_V.TS_CONCLUSAO, CP_PEDIDO_V.COD_VENDEDOR, "); 
            strSQL.Append("          CP_PEDIDO_V.TS_ENVIO_SAP, CP_PEDIDO_V.NR_CONTROLE_PORTAL, CP_PEDIDO_V.ID_TIPO_DOCUMENTO, CP_PEDIDO_V.ID_CONDICAO_PAGTO, "); 
            strSQL.Append("          CP_PEDIDO_V.DT_FATURAMENTO, CP_PEDIDO_V.DS_OBSERVACAO, CP_PEDIDO_V.COD_CLIENTE_VENDA, CP_PEDIDO_V.NM_CLIENTE_VENDA, "); 
            strSQL.Append("          CP_PEDIDO_V.DS_CIDADE_VENDA, CP_PEDIDO_V.UF_VENDA, CP_PEDIDO_V.COD_CLIENTE_ENTREGA, CP_PEDIDO_V.NM_CLIENTE_ENTREGA, "); 
            strSQL.Append("          CP_PEDIDO_V.DS_CIDADE_ENTREGA, CP_PEDIDO_V.UF_ENTREGA, CP_PEDIDO_V.TS_CANCELADO, CP_PEDIDO_V.NOME_VENDEDOR, "); 
            strSQL.Append("          CP_PEDIDO_V.DS_OBSERVACAO_PEDIDO, CP_TIPO_DOCUMENTO.DS_TIPO_DOCUMENTO, CP_CONDICAO_PAGTO.DS_CONDICAO_PAGTO, "); 
            strSQL.Append("              (SELECT     SUM(COALESCE(cp_pedido_item.vl_item_total, 0)) "); 
            strSQL.Append("                FROM          cp_pedido_item "); 
            strSQL.Append("                WHERE      cp_pedido_item.id_pedido = cp_pedido_v.ID_PEDIDO) AS VL_TOTAL "); 
            strSQL.Append("                FROM        CP_PEDIDO_V, CP_CONDICAO_PAGTO, CP_TIPO_DOCUMENTO "); 
            strSQL.Append("                WHERE       CP_PEDIDO_V.ID_CONDICAO_PAGTO = CP_CONDICAO_PAGTO.ID_CONDICAO_PAGTO AND  "); 
            strSQL.Append("          CP_PEDIDO_V.ID_TIPO_DOCUMENTO = CP_TIPO_DOCUMENTO.ID_TIPO_DOCUMENTO AND (CP_PEDIDO_V.TS_CANCELADO IS NULL) "); 
            strSQL.Append("           AND (CP_PEDIDO_V.NR_ORDEM_COMPRA in (" + _strVarIdPedido + "))"); 
 
 
            clsDal.CreateCommand(strSQL.ToString(), CommandType.Text); 
 
            System.Data.DataSet ds = clsDal.GetDataSet(); 
 
            this.DataSource = ds; 
 
        } 
 
        private void subReport1_ItemDataBinding(object sender, System.EventArgs e) 
        { 
            Telerik.Reporting.Processing.ReportItemBase item = ((Telerik.Reporting.Processing.ReportItemBase)sender); 
            try 
            { 
                if (null != item) 
                { 
                    ReportDetalhePedido pedidoDetalhe = new ReportDetalhePedido(); 
 
                    pedidoDetalhe.IDPedido = "'" + item.DataObject["NR_ORDEM_COMPRA"].ToString().PadLeft(5, '0') + "'"
 
                    subReport1.ReportSource = pedidoDetalhe; 
                } 
            } 
            catch { } 
        } 
 
    } 

My SubReport

namespace Eorder_Reporting 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
    using Telerik.Reporting; 
    using Telerik.Reporting.Drawing; 
    using Report.dal; 
    using System.Text; 
    using System.Data; 
 
    /// <summary> 
    /// Summary description for ReportDetalhePedido. 
    /// </summary> 
    public partial class ReportDetalhePedido : Report 
    { 
        public ReportDetalhePedido() 
        { 
            /// <summary> 
            /// Required for telerik Reporting designer support 
            /// </summary> 
            InitializeComponent(); 
 
            // 
            // TODO: Add any constructor code after InitializeComponent call 
            // 
            this.DataSource = null;
 
        } 
        string _strVarIdPedido; 
        public string IDPedido 
        { 
            get { return _strVarIdPedido; } 
            set { _strVarIdPedido = value; } 
        } 
 
        private void ReportDetalhePedido_NeedDataSource(object sender, System.EventArgs e) 
        { 
            dal clsDal = new dal(); 
 
            StringBuilder strSQL = new StringBuilder(); 
 
            strSQL.Append("SELECT    CP_PEDIDO_ITEM.ID_PEDIDO_ITEM, CP_PEDIDO_ITEM.ID_PEDIDO, CP_PEDIDO_ITEM.QTD_ITEM, CP_PEDIDO_ITEM.TS_INCLUSAO,  "); 
            strSQL.Append("          CP_PEDIDO_ITEM.TS_CANCELADO, CP_PEDIDO_ITEM.COD_PRODUTO, CP_PEDIDO_ITEM.NM_PRODUTO, CP_PEDIDO_ITEM.DS_BU,  "); 
            strSQL.Append("          CP_PEDIDO_ITEM.DS_UNIDADE, CP_PEDIDO_ITEM.COD_CLASSIFIC_PIG_POULTRY, CP_PEDIDO_ITEM.ID_TABELA_PC_PIG,  "); 
            strSQL.Append("          CP_PEDIDO_ITEM.ID_TABELA_PC_POULTRY, CP_PEDIDO_ITEM.VL_ITEM, CP_PEDIDO_ITEM.FL_FINS_AGROPEC,  "); 
            strSQL.Append("          CP_PEDIDO_ITEM.VL_ITEM_TOTAL, CP_PEDIDO_V.NR_ORDEM_COMPRA "); 
            strSQL.Append("          FROM         CP_PEDIDO_V, CP_PEDIDO_ITEM "); 
            strSQL.Append("          WHERE     CP_PEDIDO_V.ID_PEDIDO = CP_PEDIDO_ITEM.ID_PEDIDO AND (CP_PEDIDO_V.NR_ORDEM_COMPRA = " + _strVarIdPedido + ") "); 
            strSQL.Append("          ORDER BY CP_PEDIDO_ITEM.DS_BU, CP_PEDIDO_ITEM.NM_PRODUTO"); 
 
            clsDal.CreateCommand(strSQL.ToString(), CommandType.Text); 
 
            System.Data.DataSet ds = clsDal.GetDataSet(); 
 
            this.DataSource = ds; 
        } 
    } 

Someone can help me?

Thanks

Steve
Telerik team
 answered on 30 Apr 2009
2 answers
199 views
Hi,

I have created a report using the telerik reporting tool.
In detail section i set the property columncount = 3 to show three columns in detail section.
I was surprised to see that this is working right in Preview but it goes off in HTML Preview.
Please help me, what will be the possible causes for the misbehavior? How i can overcome this problem?

I want to show three columns in detail section using the Column Count property.

Thanks.
shadow
Top achievements
Rank 2
 answered on 30 Apr 2009
4 answers
191 views

Hi.
 
 After upgrading to Q1 2009 of Reporting I cannot send the parameters to the report.
 
My code is as follows:

        Dim report_generalAudit = New ReportsCL.GeneralAuditReport
        report_generalAudit.DataSource = resultsDataTable

        Me.viewer.Report = report_generalAudit

        Me.viewer.Report.ReportParameters("StartDate").Value = startDate
        Me.viewer.Report.ReportParameters("EndDate").Value = endDate 
  
  I get the following exception:
  
  Input string was not in a correct format.
  
  on
   Me.viewer.Report.ReportParameters("StartDate").Value = startDate

   
Am I doing something wrong?

Thanks in advanced.
  

Steve
Telerik team
 answered on 29 Apr 2009
2 answers
158 views
hi there, I am using the Report Q1 3.0.9.311
I have included telerik.reporting, telerik.reporting.design, telerik.reporting.interfaces and telerik.reporting.Processing, as well as telerik.reportviewer.design and webforms in the assmbily BIN Folder
The Preview is fine, however, When i try to export it to PDF or other formats, it only generates a blank page

I have a dev server and local dev enviroment all fine....
do you know what can cause this problem?

=====================================

Problem Found, it's the known issue that when hiding HTML textbox, PDF generate blank

waiting for new version
Steve
Telerik team
 answered on 29 Apr 2009
4 answers
239 views
Is it possible to change the parent item of an item from within the designer?  If not, how can it be done in code?

I created a Panel inside of a Panel (let's call it Parent1).  However, I would like to move it to a different Panel (Panel2) without having to recreate it since its contents are pretty complex.  I'm not sure how to do this - when I drag the Panel, its parent is still Panel1 even if it is physically located inside Panel2.

Thanks.
Steve
Telerik team
 answered on 28 Apr 2009
1 answer
129 views

Html text box displayed this sample,
<html><div>
<p style="text-indent: 0cm; margin: 0cm 0cm 0pt"><strong><font size="1" face="Arial"><span style="font-size: 9pt; font-weight: normal"> “Omurgalıların embriyonik gelişmesi sırasında, sırt mezoderminin sırt ektodermini etkilemesiyle sinir sistemi oluşur.” hipotezini kuran bir bilim adamı, “Embriyodaki sırt mezodermi ile karın mezoderminin yeri değiştirilirse, karın ektoderminden de sinir sistemi oluşabilir.” görüşünü ileri sürüyor.</span></font></strong></p>
<p style="text-indent: 0cm; margin: 0cm 0cm 0pt"><strong><font size="1" face="Arial"><span style="font-size: 9pt">Buna göre, bilim adamı bilimsel çalışmanın hangi aşamasını gerçekleştirmiştir?</span></font></strong></p>
</div>
</html>

but, did not display this sample. Why?
<html><div>

<p style="margin:0cm;margin-bottom:.0001pt;text-indent:0cm"><b><font size="1" face="Arial"><span style="font-size:9.0pt">Biyolojinin dallarından olan
fizyoloji, aşağıdakilerden hangisini <u>incelemez</u>?</span></font></b></p>

</div>
</html>

How can I do? (these html codes converted via MS Word)

Steve
Telerik team
 answered on 27 Apr 2009
1 answer
113 views

 

Hi,

I'm trying to export RadGridView data to a teleric report. I found the RadGridReportingLite sample project on the teleric website and have been playing around with it. My question for anyone of you that have used it or designed it is -  can i tweak the radgridReport class to include items in the gridSummaryRow collection or do i need to add a custom row to my grid which will perform aggregation ?

Thanks in advance
Anisha
Martin Vasilev
Telerik team
 answered on 27 Apr 2009
1 answer
147 views
I created a report in Q3, and reading a number in from a field, what I would like to do is format the number like this

if the number is > then 8 digits, format it like this ### ### ###

if it is <= 8 digits format it like this #### ####

how would I do this, I am new to all of this and still learning please guide me in the right direction, or maybe a video or certain page in the manual would be great.

thanks in advance

Pete
Steve
Telerik team
 answered on 27 Apr 2009
0 answers
175 views
Hello, my name is Silvia and i have a question.
I'm using pie chart and I want to make slices of cake in pie of a different color depending on a field of dataset. The color I want is a field of the dataset. How can I do? 
Thanks for your help,
Silvia
SIlvia
Top achievements
Rank 1
 asked on 27 Apr 2009
5 answers
189 views
Hello,

I was trying the Export programmatically from the documentation http://www.telerik.com/help/reporting/programmatic-exporting-report.html.

Then I encountered this error NotImplementedException unhandled by as user code.
at Telerik.Reporting.Processing.ItemFactory.CreateItem(ReportItemBase itemDef)    at Telerik.Reporting.Processing.ReportProcessor.ProcessReport(Report reportDefinition)    at Telerik.Reporting.Processing.ReportProcessor.Render(String format, Report report, Hashtable deviceInfo, CreateStream createStreamCallback, String& documentName)    at Telerik.Reporting.Processing.ReportProcessor.Render(String format, Report report, Hashtable deviceInfo, String& mimeType, String& documentName, String& extension, Encoding& encoding)    at Telerik.Reporting.Processing.ReportProcessor.Render(String format, Report report, Hashtable deviceInfo, String& mimeType, String& extension, Encoding& encoding)    at MyReportViewer.PDF.Page_Load(Object sender, EventArgs e) in D:\Documents and Settings\ajs\My Documents\Visual Studio 2008\Projects\MyReportViewer\MyReportViewer\PDF.aspx.vb:line 12    at System.Web.UI.Control.OnLoad(EventArgs e)    at System.Web.UI.Control.LoadRecursive()    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

My goal was to try to make FontEmbedding flexible during export instead of hardcoding in webconfig. User can have their choice to either embed or not to embed the Arial Unicode. This will give more flexibility for pdf export.

I tried to search for this error but I cant find any reference, may I know whats the cause of the error, or do you have any working sample project that use the fontembedding.

Thanks


Steve
Telerik team
 answered on 27 Apr 2009
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?