Here is my problem. Our shop has three environments that the development team must work with, development, testing and production. I have successfully been able to change the DataSource (WebServiceDataSource) of the master report by changing the ServiceUrl. For subreports I have been able to change the ReportSource based on the environment but I have not been able to locate a way to change the DataSource. Does anyone have an idea how this is done?
Here is the code I have right now:
public class TexasProtaxCustomReportResolver : Telerik.Reporting.Services.Engine.IReportResolver
{
private readonly string _path;
private readonly string _apiUrl;
public TexasProtaxCustomReportResolver(string path, string apiUrl)
{
_path = path;
_apiUrl = apiUrl;
}
public Telerik.Reporting.ReportSource Resolve(string reportName)
{
var reportPacker = new ReportPackager();
string reportPath = Path.Combine(_path, reportName);
using (var sourceStream = System.IO.File.OpenRead( reportPath))
{
var report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream);
SetReportSource((ReportItemBase)report);
var irs = new InstanceReportSource
{
ReportDocument = report
};
return irs;
}
}
private void SetReportSource(ReportItemBase reportItemBase)
{
if (reportItemBase.Items.Count < 1)
return;
if (reportItemBase is Telerik.Reporting.Report)
{
var report = (Telerik.Reporting.Report)reportItemBase;
var webServiceDataSource = (WebServiceDataSource)report.DataSource;
string url = webServiceDataSource.ServiceUrl;
url = url.ToLower().Replace("localhost:5001", _apiUrl);
webServiceDataSource.ServiceUrl = url;
}
foreach (var item in reportItemBase.Items)
{
// recursively set the reportsource
SetReportSource(item);
if (item is SubReport subReport)
{
// Save Parameters
var clonable = subReport.ReportSource.Parameters as ICloneable;
var parameters = (ParameterCollection)clonable.Clone();
string fileName = Path.GetFileName(subReport.ReportSource.ToString());
var uriReportSource = new UriReportSource
{
Uri = Path.Combine(_path, fileName)
};
uriReportSource.Parameters.AddRange(parameters);
subReport.ReportSource = uriReportSource;
continue;
}
}
}
}
Ticket :1453373
Report shows all records in Visual Studio when I Preview it in the preview page but when running the winform application from the IDE (and as a stand alone app) the viewer stops when record count ~> 220 records showing the above error. When I capture the error event and display said error in a messagebox the first page is displayed. On it I can see that pages are calculated (as my first page displays page 1 of 75) so I can conclude that the records are definitely getting retrieved, just not displayed. I say that the record count is ~> 220 because when I narrow the parameters to display < 220 records the report is generated fine: adding 10 more records to the report causes the error.
As I said, the report previews perfectly.
I call the report using
Dim TR As MaserNET.ReportViewerForm1 = New MaserNET.ReportViewerForm1
TR.ReportName = "Maserrep.DDRegister, Maserrep, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null"
TR.ShowDialog()
and the viewer shows the report using
Dim typeReportSource = New Telerik.Reporting.TypeReportSource()
Dim connectionStringHandler = New ReportConnectionStringManager(GlobalConnection.ConnectionString)
typeReportSource.TypeName = ReportName
Dim reportSource = connectionStringHandler.UpdateReportSource(typeReportSource)
Me.ReportViewer1.ReportSource = reportSource
Me.ReportViewer1.RefreshReport()
What am I missing????
When using IE, the print button does not work at all. Nothing happens.
In Edge, the print button initiates an export to PDF which provides the option to save the file or open it in Reader.
In Chrome, the button works as expected opening an Adobe print dialog.
Are there settings in the browser preventing the system print dialog? Is there some setting in the Report Viewer I can modify to make this work uniformly across all 3 browsers?
I have been researching all day I can't find a solution. I have tried to build a custom resolver to change the server name and port as a test. I have coded this class it returns null because I cannot determine how to return a ReportSource.
public class TexasProtaxCustomReportResolver : Telerik.Reporting.Services.Engine.IReportResolver
{
public Telerik.Reporting.ReportSource Resolve(string reportName)
{
var reportPacker = new ReportPackager();
using (var sourceStream = System.IO.File.OpenRead(reportName))
{
var report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream);
var webServiceDataSource = (WebServiceDataSource)report.DataSource;
string url = webServiceDataSource.ServiceUrl;
url = url.ToLower().Replace("localhost:5001", "localhost:44384");
webServiceDataSource.ServiceUrl = url;
return null;
}
}
}
In the ReportsConttroller I have tried adding the resolver but it has an error:
public ReportsController(ConfigurationService configSvc)
{
this.reportsPath = Path.Combine(configSvc.Environment.WebRootPath, "Reports");
this.ReportServiceConfiguration = new ReportServiceConfiguration
{
ReportingEngineConfiguration = configSvc.Configuration,
HostAppId = "ReportsService",
Storage = new FileStorage(),
ReportResolver = new ReportTypeResolver()
.AddFallbackResolver(new ReportFileResolver(this.reportsPath))
.AddFallbackResolver(new TexasProtaxCustomReportResolver())
};
}
Any assistance would be appreciated.
Hi
I am attempting to get trdp files to generate a pdf in a .net core application using ObjectDataSource.
in my appsettings I have the following code to reference my dll.
"telerikReporting": {
"assemblyReferences": [
{
"name": "Goalie.Shared",
"version": "1.0.0.0",
"culture": "neutral",
"publicKeyToken": "null"
}
]
}
running the report results in error The assembly "EXTERNAL_ASSEMBLY_TYPE" is not permitted to be used by an ObjectDataSource component. Please include it in an AssemblyReferences element in the Telerik.Reporting configuration section of your application configuration file.
But when I put in a app.config as suggested https://www.telerik.com/forums/reporting-asp-net-core-rest-service-configuration#f0fajfr44E6tvOjTRMr33g,
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
configSections
>
<
section
name
=
"Telerik.Reporting"
type
=
"Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting"
allowLocation
=
"true"
allowDefinition
=
"Everywhere"
/>
</
configSections
>
<
Telerik.Reporting
>
<
AssemblyReferences
>
<
add
name
=
"Goalie.Shared"
version
=
"1.0.0.0"
/>
</
AssemblyReferences
>
</
Telerik.Reporting
>
</
configuration
>
everything works fine.
Should we still need this step? What are the requirements so that the telerikReporting section of the appsettings.json are read? I have made sure all of the dlls are installed as specified here https://docs.telerik.com/reporting/use-reports-in-net-core-apps
Its not a big deal but seems un-nessesary. Any ideas?
I feel like I'm going mad.
We have an ASP.NET Core 2.2 app running for a client in an Azure app service. There is a single large report used within the application which, with 3 sub reports included, produces a 7 page report output. All report design files are stored as .trdp including the sub-reports. The report files are all hosted in the wwwroot\Reports folder together. I have some minor problems in the reports where some textboxes are not displaying the correct information or in one case has a typo. I've corrected all the issues in my copy of the .trdp files and I've published the entire app via VS 2017 to the Azure app service and the reports haven't changed. I've connected to Azure via FTP and manually deleted the report files and if I then run the report in the web app it tells me it can't find the report file correctly - likewise if I just delete the report file for a sub-report then the main report displays but there is an error where the sub-report should be. I re-upload my local version of the report file I'd deleted and run the report through the web app and again the report displays without errors but it still displays the previous version of the report. The report has a company logo in the header of every page of the report. If I delete the logo from my version of the report and copy that over via FTP, when I run the report the logo has gone from the report but the text is still wrong.The typo I have corrected is to change the word "clumn" to the correct spelling "column" but every time the word appears in the report missing the 'o'. I have some other textboxes that concatenate text with field values and I've had to change the fields being used or had to add additional field values together and they are not changing, the text continuing to show the previous incorrect values.
Help! What the hell is going on here? What am I missing? How can I remove a logo from the trdp file and the report displays without the logo but still shows the incorrect textboxes throughout the report? What do I need to do to make the report (and sub-reports) pick up the correct report files? I've restarted the Azure app service and shut it down completely then started it again. I've used 2 different browsers but still I get the same symptoms. I urgently need some advice to help me get to the bottom of this. The application should be live this week but can't be without the report being absolutely accurate which it currently is not.
Thanks in advance for any and all advice
Hello all,
Is there a way to get Telerik reports old version files ( Should .net framework 2.0 ) .? One of my client has GP10 version and we did a Add-in project for GP .
In that project we need to run report . I have latest controls ( .Net framework 4.5 and above ) but those are not accept in GP10 .
Can anybody help me how to get .net framework 2.0 telerik assembly files and How can i run the report using vb.net windows form.
Thanks
Victor Athoti.
I have some thing like this
COL1 COL2
a 1
b 2
c 3
d 4
4 =====> this is what im asking for
I want to get last item of the row.. I have been using sum and its helpful but this time I want to get the last item. how do I do that?