Telerik Forums
Reporting Forum
1 answer
320 views

Hi,

 I've got a user defined functions which is included in a EncounterDatasource.dll below is the code

[Function(Category = "My Functions", Namespace ="My",Description= "Get array item")]
public static string GetArrayItem(string[] values,int index)
{
   return values[index];
}

My problem is upon deployment it cause error in the fields using the said functions. The error is

An error has occurred while processing TextBox 'textBox81': The expression contains object 'My' that is not defined in the current context.

On the Telerik Report Designer its working fine since I've able to add the dll reference in the Telerik.ReportDesigner config but not on the application its not working. I've also made a reference to the dll from my project and make sure it reside with the report. What would be the possible cause of this and how would I deploy report using user defined functions from external dll?

 

Regards,

Jordan

Stef
Telerik team
 answered on 13 Oct 2015
1 answer
355 views

 Our requirement is to show excel icon and pdf icon for easy access, ability to pass parameter directly instead of dropdown similar to print icon

 <li><a data-command="telerik_ReportViewer_print" title="Print" href="#"><i class="fa fa-print icon-print"></i></a></li>

we need to show excel and pdf similar to print icon in template.​

what data-command do we use, i dont see one.

http://www.telerik.com/help/reporting/html5-report-viewer-data-attributes.html

 also if we have export in dropdown list how do we control the styles..need to update z-index and its not working for us. 

<div class="k-animation-container" style="width: 82px; height: 27px; margin-left: -2px; padding-left: 2px; padding-right: 2px; padding-bottom: 4px; overflow: visible; display: block; position: absolute; z-index: 10002; top: 29px; left: 0px;"><ul data-command-list="export-format-list" class="k-group k-menu-group k-popup k-reset k-state-border-up" role="menu" data-role="popup" style="display: block; position: absolute; font-size: 12px; font-family: abc-regular; font-stretch: normal; font-style: normal; font-weight: 400; line-height: 15px;"><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="PDF" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>Acrobat (PDF) file</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="CSV" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>CSV (comma delimited)</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="XLS" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>Excel 97-2003</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="XLSX" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>Excel Worksheet</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="PPTX" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>PowerPoint Presentation</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="RTF" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>Rich Text Format</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="IMAGE" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>TIFF file</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="MHTML" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>Web Archive</span></a></li><li class="k-item k-state-default" role="menuitem"><a data-command-parameter="DOCX" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>Word Document</span></a></li><li class="k-item k-state-default k-last" role="menuitem"><a data-command-parameter="XPS" data-command="telerik_ReportViewer_export" href="#" class="k-link"><span>XPS Document</span></a></li></ul></div>​

Nasko
Telerik team
 answered on 13 Oct 2015
1 answer
504 views

Hello,

Printing from Microsoft Edge doesn't look promising in general right now.  Microsoft and thousands of users seem to indicate that it doesn't work correctly.

That being said has Telerik looked into getting the print dialog to come up in Edge?  As of now the print button causes a PDF to download much like it did with Firefox some years back.  I'm wondering if there is a similar workaround for Edge.

Thank you!

Nasko
Telerik team
 answered on 12 Oct 2015
1 answer
260 views

Hi all,

have an assembly with some user-defined functions. To use it in our another project (and in VS designer) i had to add this snippet to my config(s):

 

    <Telerik.Reporting>

        <AssemblyReferences>
            <add name="MyAssemblyName" version="1.0.0.0" culture="neutral" publicKeyToken="null" />
        </AssemblyReferences>
    </Telerik.Reporting>​

 

All this worked fine until we decided to have real version numbers for all assemblies in our solution. So, one day, we replaced

[assembly: AssemblyVersion("1.0.0.0")]

with

[assembly: AssemblyVersion("1.0.*")]

 in the AssemblyInfo.cs file of MyAssemblyName project. Now Telerik Reporting cannot resolve MyAssemblyName because of the wrong version number.

 

So, my question is: is there any way to have an AssemblyReference without specifying the exact version number?

Thanks in advance.

 

P.S. I've tried omitting "version" altogether, specifying version ranges, wildcards etc. Nothing helps :-(.

 

 

 
Stef
Telerik team
 answered on 12 Oct 2015
1 answer
207 views

one of my my data source object List<int> categoriesIds = {1, 2, 3}

I want using multiple value parameters filter the datasource 

 I using Field.Categories(List<int>) in = Parameters.categories.Value, but this is not working

 

Nasko
Telerik team
 answered on 12 Oct 2015
9 answers
546 views
I am using a table wizard in the details section to generate the columns i need for my database records...but the problem i face is that the
table repeats itself after the end of recordset..How Can i stop it from doing it....

Thank you
 
Nasko
Telerik team
 answered on 12 Oct 2015
1 answer
166 views

Hi,

 I use a custom IReportResolver in combination with the ReportConnectionStringManager and it works well.  However my next requirement is to support subreports where the ReportSource property is set to a parameter, e.g. = Parameters.invoiceReport.Value.   This is a problem when attempting to update the connection string on the subreport, the name is given as the expression, not the evaluation of the expression.  It seems that I can evaluate the expression myself with a bit of work and checking the Http context request referrerUrl property, but looks a bit fragile.

 

If you look at the code for ReportConnectionStringManager you can see that it assumes here:

using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))

that the Uri is already evaluated, but it's not, it is the string "= Parameters.invoiceReport.Value".   Do you have any suggestions other than evaluating the expression myself?

 

Thanks,

Stef
Telerik team
 answered on 12 Oct 2015
2 answers
416 views

Hi,

 

Been trying to set the figure out how to properly set the data of my sub report, thru searching on the threads I managed to come up with this code but testing it still does not show the data of my subreport. For the main report its seems fine, it there anything I miss out?

Below is the code

private void Form1_Load(object sender, EventArgs e)
        {
            var service = new TelerikReportDatasource.Service.ReportServiceEncounter();
 
            var reportParameter = new TelerikReportDatasource.ParameterModel.ViewReportEncounter1ParameterModel
            {
                ProviderId = 1,
                PatientId = 0,
                PatientCaseId = 0,
                ApptDate = Convert.ToDateTime("9/28/2015"),
                EncounterDate = Convert.ToDateTime("9/28/2015"),
                IgnoreMainSettings = false,
                IsTimeCheck = false,
                IsPrintedCheck = true,
                IsSortByAlpha = false,
                ConnectionString = "some connection string",
                IsMandatoryNPExam = false,
                OnePerAppt = false,
                ShowCTytd = true,
                PastVisit = true,
                FutureAppt = true,
                NumberFutureAppts = 0,
                SetCPTList = true,
                DiagCount = 12,
                SetEncMemo = true,
                SetEncSpec = true,
                SystemTimeZone = 2,
                UserTimeZone = 2
 
            };
 
            var telerikReportSource = service.GetReportData(reportParameter);
 
            var reportObjectDatasource = new ObjectDataSource();
            reportObjectDatasource.DataSource = telerikReportSource.Encounter1Data;
            reportObjectDatasource.DataMember = "GetEncounter1";
            var uriReportSource = new UriReportSource();
            uriReportSource.Uri = "rptEncounter.trdx";
 
            var report = DeserializeReport(uriReportSource);
            report.DataSource = reportObjectDatasource;
 
            //Set the subreport datasource
            var subReportPatDiag = (SubReport)report.Items.Find("PatDiag", true).FirstOrDefault();
            var subReportPatDiagReportsource = (UriReportSource)subReportPatDiag.ReportSource;
            subReportPatDiagReportsource.Parameters.Add("ApptID", telerikReportSource.Encounter1Data.FirstOrDefault().AppointID);
            var reportPatDiag = DeserializeReport(subReportPatDiagReportsource);
            var reportPatDiagSource = (ObjectDataSource)reportPatDiag.DataSource;
            reportPatDiagSource.DataSource = telerikReportSource.Encounter4Data;
            reportPatDiagSource.DataMember = "GetEncounter4";
            reportPatDiag.DataSource = reportPatDiagSource;
 
             
            var reportSource = new InstanceReportSource();
            reportSource.ReportDocument = report;
             
            reportViewer1.ReportSource = reportSource;
            reportViewer1.RefreshReport();
 
        }
 
        /// <summary>
        /// Deserialize the TRDX report file from uri report to be able to use it as a report
        /// </summary>
        /// <param name="uriReportSource"></param>
        /// <returns></returns>
        Report DeserializeReport(UriReportSource uriReportSource)
        {
            var settings = new System.Xml.XmlReaderSettings();
            settings.IgnoreWhitespace = true;
            using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))
            {
                var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
                var report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
                return report;
            }
        }

Help is greatly appreciated

Jordan
Top achievements
Rank 1
 answered on 09 Oct 2015
4 answers
510 views

 Hi,

 Using the HTML report viewer I am generating the html/javascript from an aspx class and am adding date parameters so that the resulting Javascript looks like this:

 

$("#reportViewer1")
    .telerik_ReportViewer({
         
        // The URL of the service which will serve reports.
        // The URL corresponds to the name of the controller class (ReportsController).
        // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
        serviceUrl: "api/reports/",
 
        // The URL for the report viewer template. The template can be edited -
        // new functionalities can be added and unneeded ones can be removed.
        // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
        templateUrl: 'ReportViewer/templates/telerikReportViewerTemplate-9.2.15.930.html',
 
        //ReportSource - report description
        reportSource: {
 
            // The report can be set to a report file name (trdx report definition)
            // or CLR type name (report class definition).
            report: "ReasonsForDemurrageBasic",
 
            // Parameters name value dictionary
            parameters: {
                restrictClientAccountCompanyKey : 1,portKey : 2,dateFormat : "dd/MM/yy",startDate : new Date("2015/01/01"),endDate : new Date("2015/11/01"),suppressTitles : false
            }
        },

 

So you can see that I am setting up to date parameters without times.  I want these dates to be passed back when executing the report as is, I don't want any timezone conversion.  When the report is run, using Fiddler I can see that the request is:

 

{"report":"ReasonsForDemurrageBasic","parameterValues":{"restrictClientAccountCompanyKey":1,"portKey":2,"dateFormat":"dd/MM/yy","startDate":"2015-01-01T05:00:00.000Z","endDate":"2015-11-01T05:00:00.000Z","suppressTitles":false}}

 

You can see that it has assumed that I want the dates converted (with an assumption of a time if 0:0:0 in my local timezone) into UTC.  I realise that the trend now is for JSON to write dates in this format with the timezone, but is there a way without hacking telerikReportViewer-9.2.15.930.min.js to stop it adjusting the time?  "startDate":"2015-01-01T00:00:00.000Z" would be ok for example in this case.

 

Thanks,

 Scott

Stef
Telerik team
 answered on 09 Oct 2015
5 answers
73 views
Hello,

How can I get a specific version of Telerik Reporting ? =  (v7.1.13.612)

Thanks
Stef
Telerik team
 answered on 09 Oct 2015
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?