Telerik Forums
Reporting Forum
1 answer
101 views

Please excuse me because I am not familiar with English.

 

Hi. 

My WinForm is open report and report is open the secend report by subreport .

firstreport is passing 6parameter

--------------------------------------------------------------------------------------------------------------------------------------------------

            Telerik.Reporting.TypeReportSource typeReportSource1 = new Telerik.Reporting.TypeReportSource();
            typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("AS_PLANTCODE", "=FIELDS.PLANTCODE"));
            typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("AS_LOTNO", BarCode));
            typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("AS_FIRSTFLAG", "=FIELDS.FIRSTFLAG"));
            typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("AS_FROM", "=FIELDS.FROM"));
            typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("AS_TO", "=FIELDS.TO"));
            typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("AS_ODD", "1"));
            typeReportSource1.TypeName = "DAS.DA3301_R_Private_Sub1, DAS, Version=1.0.3.2, Culture=neutral, Pub" +
    "licKeyToken=null";
            this.subReport1.ReportSource = typeReportSource1;

--------------------------------------------------------------------------------------------------------------------------------------------------

and subreports are queried using parameters from parent reports in the data source.

subreport is output and 5 Textbox and 1 Picturebox

I want to use the parameter values of the designer in the source,

When i get the value into the source, value = "=Parameters.AS_LOTNO.Value"  be perceived as 

But if i use it to print out, "0001010101:20200131:1:2"

how can i use designer parameters in sourcecode ..TT

Todor
Telerik team
 answered on 04 Feb 2020
4 answers
705 views
Hey

I have a report screen with a collapsible pane, and when we load a report then collapse the pane the report viewer resizes, BUT, the scrollbar in the report viewer doesn't adjust itself.   What's the right way to trigger a UI refresh in the report viewer?

viewerContainerStyle = {
  position: 'absolute',
  width: '100%',
  height: '100%',
  ['font-family']: 'ms sans serif'
};

<tr-viewer #viewer1
           *ngIf="showReport"
           [containerStyle]="viewerContainerStyle"
           [serviceUrl]="serviceURL"
           [reportSource]="{report: filename, parameters: parameters}"
           templateUrl="assets/telerikReportViewerTemplate.html"
           [viewMode]="'PRINT_PREVIEW'"
           [scaleMode]="'FIT_PAGE_WIDTH'"
           [scale]="1.0"
           [enableAccessibility]="false">
</tr-viewer>

Right now I'm toggling showReport which causes the report viewer to redraw itself, fixing the issue, but some of the reports take a while to render and this is exceedingly annoying.

Thanks


Veronika
Telerik team
 answered on 04 Feb 2020
2 answers
255 views
Hi Guys

I am using a provided example of reporting , to create an interface listing the available reports in a DLL.

Everything is working great, however the 3rd item always gets added as a new row and aligned right. I cannot work out why..

Any thoughts or suggestions please.. I have tried widths and margins and looked at the panel and the crosstab properties looking for perhaps a column count limit etc.. but if it was just adding a new row, I would have expected the 3rd item to be left aligned.

Screen shots attached.

Many many thanks

Rob
Todor
Telerik team
 answered on 03 Feb 2020
5 answers
476 views

I have been searching and reading for the last 4 hours to find any resource to create an objectdatasource for an Asp.net Core application.  All the samples use framework 4+.  I have three tiers in my application the first layer is the Entity/Model layer the middle tier is the service layer/Business logic layer and the final tier is the Web/UI layer.

I have successfully created a reportviewer that displays an embedded sql with parameters but what I am trying to do is to take an IQueryable<T> from the service layer and populate the report.  Is there an example available?

Todor
Telerik team
 answered on 03 Feb 2020
1 answer
619 views
Is it possible to generate QR Code of an image or pdf document in telerik reporting
Neli
Telerik team
 answered on 03 Feb 2020
1 answer
90 views

Hi all,

I am trying to Encrypt the password in the telerik designer report source , kindly help me to resolve this issue.Image is attached for reference.

Todor
Telerik team
 answered on 31 Jan 2020
1 answer
104 views

Hi, currently I'm create table report programmatically. Here I attach the code for generate the report in <report>. Then I call the report in user control form. In the user control form, I create the filter button "proceed". Then I do the filter in the UC form and I pass the filter in the GetData() function in <report>. The problem is the parameter value is reset then it will generate the report before filter. The parameter value I set in User control form <ucReport>. The picture shows that I have done filter the search by date from 1/1/2020 - 15/1/2020. But the table not filter. 

<report>

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
using Telerik.Reporting.Charting;
using Telerik.Reporting.Processing;
using MYScanLibrary;
using System.Data;

namespace MYScanDesktop
{


    /// <summary>
    /// Summary description for Report2.
    /// </summary>
    public partial class jkdmReport1 : Telerik.Reporting.Report
    {
        System.ComponentModel.BindingList<Entry> ReportEntry;

        // private List<Graph> GraphData;
        private string testfilter = "";
        public jkdmReport1()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            ReportEntry = new System.ComponentModel.BindingList<Entry>();
            GenerateReport();
            
           
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        public void setFilter(String f)
        {
            testfilter = f;
           MessageBox.Show("testfilter1: " + testfilter);
        }

        public String getFilter()
        {
            
            return testfilter;
           
        }

        public DataTable GetData()
        {
            //String filter = a;
            ReportEntry.Clear();
            dynamic table = new DataTable();

           // this.StartDate.Value = "= Parameters.StartDate.Value";
           
            MessageBox.Show(StartDate.Value.ToString());
            
            int myentry = Program.myScanDB.queryEntry(ReportEntry, testfilter);
           
            table.Columns.Add("ID", typeof(string));
            table.Columns.Add("DateTime", typeof(string));
            table.Columns.Add("Gate", typeof(string));
            table.Columns.Add("Lane", typeof(string));
            table.Columns.Add("LPN", typeof(string));
            table.Columns.Add("BackLPN", typeof(string));
            table.Columns.Add("ContainerNo", typeof(string));
            table.Columns.Add("BackContainerNo", typeof(string));
            table.Columns.Add("WIM", typeof(string));
            table.Columns.Add("WIMDoc", typeof(string));
            table.Columns.Add("Wheel Base", typeof(string));
            table.Columns.Add("RM", typeof(string));
            table.Columns.Add("Status", typeof(string));

            for (int i = 0; i < myentry; i++)
            {
                //add data rows value in each column
                table.Rows.Add(
                    ReportEntry[i].ID.ToString(),
                    ReportEntry[i].Datetime.ToString(),
                    ReportEntry[i].Gate.ToString(),
                    ReportEntry[i].Lane.ToString(),
                    ReportEntry[i].LPN.ToString(),
                    ReportEntry[i].BackLPN.ToString(),
                    ReportEntry[i].ContainerNum.ToString(),
                    ReportEntry[i].BackContainerNum.ToString(),
                    ReportEntry[i].WIM.ToString(),
                    ReportEntry[i].WIMDoc.ToString(),
                    ReportEntry[i].WheelBase.ToString(),
                    ReportEntry[i].RM.ToString(),
                    ReportEntry[i].Status.ToString()
                    );
            }

            return table;
        }

      
        public void GenerateReport()
        {
            ReportEntry.Clear();
            //create a blank Table item
            Telerik.Reporting.Table table1 = new Telerik.Reporting.Table();
           
            table1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.6), Telerik.Reporting.Drawing.Unit.Inch(0.6));
            table1.Name = "Table1";
            table1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(4), Telerik.Reporting.Drawing.Unit.Inch(1));

            //get the data for the table
            DataTable data = GetData();
            table1.DataSource = data;

            //create a dynamic row group
            Telerik.Reporting.TableGroup DetailRowGroup = new Telerik.Reporting.TableGroup();
            DetailRowGroup.Groupings.Add(new Telerik.Reporting.Grouping(null));
            DetailRowGroup.Name = "DetailRowGroup";
            table1.RowGroups.Add(DetailRowGroup);
            //add a row container
            table1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.5)));
            table1.ColumnHeadersPrintOnEveryPage = true;
            table1.RowHeadersPrintOnEveryPage = true;

            //add columns
            for (int i = 0; i <= data.Columns.Count - 1; i++)
            {
                //add a column container
                table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(2)));
                //add a static column group per data field
                Telerik.Reporting.TableGroup columnGroup = new Telerik.Reporting.TableGroup();
                table1.ColumnGroups.Add(columnGroup);

                //header textbox
                Telerik.Reporting.TextBox headerTextBox = new Telerik.Reporting.TextBox();
                headerTextBox.Name = "headerTextBox" + i.ToString();
                headerTextBox.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.571D), Telerik.Reporting.Drawing.Unit.Inch(0.533D));
                headerTextBox.Value = data.Columns[i].ColumnName;
                headerTextBox.Style.BackgroundColor = System.Drawing.SystemColors.HotTrack;
                headerTextBox.Style.Color = System.Drawing.Color.White;
                headerTextBox.Style.Font.Bold = true;
                headerTextBox.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(8D);
                headerTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
                headerTextBox.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
                headerTextBox.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
                //  headerTextBox.Style.BorderWidth.Default = Telerik.Reporting.Drawing.Unit.Pixel(1);
                columnGroup.ReportItem = headerTextBox;

                //field that will be displayed
                Telerik.Reporting.TextBox detailRowTextBox = new Telerik.Reporting.TextBox();
                detailRowTextBox.Name = "detailRowTextBox" + i.ToString();
                detailRowTextBox.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.572D), Telerik.Reporting.Drawing.Unit.Inch(0.3D));
                detailRowTextBox.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
                detailRowTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
                detailRowTextBox.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
                detailRowTextBox.Value = "= Fields.[" + data.Columns[i].ColumnName + "]";
                table1.Body.SetCellContent(0, i, detailRowTextBox);

                //add the nested items in the Table.Items collection
                table1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { headerTextBox, detailRowTextBox });
            }

       

            this.DetailSection.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { table1});

        }
    }
}

 

 

 

<ucReport>

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Telerik.Reporting;
using MYScanLibrary;
using Telerik.Reporting.Drawing;
using Telerik.Reporting.Charting;

namespace MYScanDesktop
{


    public partial class ucReporting : UserControl
    {
        jkdmReport1 myReport = new jkdmReport1();
        Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
       
        public ucReporting()
        {
            InitializeComponent();
           
            typeReportSource.TypeName = typeof(jkdmReport1).AssemblyQualifiedName;
            LoadReport();      
        }

        private void LoadReport()
        {
            
            //add parameter
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("Location", "efd"));
            
            String textStartDate = String.Format("{0}", this.datetimePickerStart.Value.ToString("dd/MM/yyyy hh:mm:ss"));
            String textEndDate = String.Format("{0}", this.datetimePickerEnd.Value.ToString("dd/MM/yyyy hh:mm:ss"));
          
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("StartDate", textStartDate));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("EndDate", textEndDate));
            typeReportSource.Parameters.AddRange(new ParameterCollection());


            //MessageBox.Show(textStartDate.ToString());
            reportviewerMain.ReportSource = typeReportSource;

            reportviewerMain.RefreshReport();
        }

        private void buttonProceed_Click(object sender, EventArgs e)
        {
        
            String whereFilter = String.Format(" WHERE et_datetime >= '{0}' AND  et_datetime <= '{1}'",
                    this.datetimePickerStart.Value.ToString("yyyy-MM-dd HH:mm:ss"),
                    this.datetimePickerEnd.Value.ToString("yyyy-MM-dd HH:mm:ss"));
            myReport.setFilter(whereFilter);
            LoadReport();
            
        }

       
    }

}

Todor
Telerik team
 answered on 31 Jan 2020
2 answers
394 views

Is it possible to use .net core dependency injection into the object set as the data source to an ObjectDataSource?

Such that...

 

[DataObject]
class Products
{
    private readonly IProductRepo _repo;
 
    public Products(IProductRepo repo
    {
         _repo = repo;
    }
 
 
    [DataObjectMethod(DataObjectMethodType.Select)]
    public IEnumerable<Prodcut> GetProducts()
    {
       _repo.GetProducts();
    }
}
Vitaliy
Top achievements
Rank 1
 answered on 30 Jan 2020
4 answers
1.3K+ views

Hi,

 

I would like to use checkbox in my report.

Selecting check box should display data and deselecting should not display data in report.

How to achieve above in Telerik report designer.

Thank you.

Web
Top achievements
Rank 1
 answered on 29 Jan 2020
1 answer
297 views

Hi all, 

I'm attempting to create a report using the standalone Report Designer. Whenever I try to run the report, I get the below error;

MySql.Data.MySqlClient.MySqlException

at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)\r\n  
at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n  
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()\r\n  
at Telerik.Reporting.Processing.Data.SqlDataEnumerable.<GetEnumerator>d__0.MoveNext()\r\n  
at Telerik.Reporting.Processing.Data.SeedDataAdapter.GroupData(IEnumerable`1 rawData)\r\n  
at Telerik.Reporting.Processing.Data.SeedDataAdapter.Execute(IEnumerable`1 data)\r\n  
at Telerik.Reporting.Processing.Data.ResultSetAdapter.Execute(IEnumerable`1 data)\r\n  
at Telerik.Reporting.Processing.Data.MultidimentionalDataProvider.Execute(MultidimensionalQuery query)\r\n  
at Telerik.Reporting.Processing.ReportParametersManager`1.CalculateParameterProperties(P parameter, IReportParameter parameterDef, IDictionary`2 parameterValues, Boolean parentChanged)\r\n  
at Telerik.Reporting.Processing.ReportParametersManager`1.Calculate(P parameter, IDictionary`2 parameterValues, Boolean parentChanged, Boolean& valueChanged)\r\n  
at Telerik.Reporting.Processing.ReportParametersManager`1.RecalculateParameters(IDictionary`2 parameterValues)\r\n  
at Telerik.Reporting.Processing.DocumentParametersManager`1.CalculateParameters(IDictionary`2 values)\r\n  
at Telerik.Reporting.Processing.DocumentParametersManager`1.GetMergedParameters(IDictionary`2 values)\r\n  
at Telerik.Reporting.Services.Engine.ReportEngine.GetParameters(String clientID, String report, Dictionary`2 parameterValues)\r\n  
at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetParameters(String clientID, ClientReportSource reportSource)\r\n  
at Telerik.ReportServer.Web.Controllers.Api.ReportsController.<>c__DisplayClassf.<GetParameters>b__e()\r\n  
at Telerik.ReportServer.Web.Controllers.Api.ReportsController.DoIfUserAvailable(Func`1 action)\r\n  
at Telerik.ReportServer.Web.Controllers.Api.ReportsController.GetParameters(String clientID, ClientReportSource reportSource)\r\n  
at lambda_method(Closure , Object , Object[] )\r\n  
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n  
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n  
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n  
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n  
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n  
at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()"

 

Can anyone please give me some insight as to why this is happening? If you need more information, please let me know.

 

Thanks!

 

Neli
Telerik team
 answered on 28 Jan 2020
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?