Hi,
I'm trying to use the following query with a SqlDataSource in a report. The query works fine if I run it from Sql Server Management Studio. I get an error, see attached image.
SQL:
declare @Temp Table
(
Namn varchar(100),
Beskrivning varchar(100),
Grupp varchar(100)
)
insert into @Temp(Namn, Beskrivning, Grupp) VALUES('41', 'Material', '41-42')
insert into @Temp(Namn, Beskrivning, Grupp) VALUES('42', 'Material', '41-42')
insert into @Temp(Namn, Beskrivning, Grupp) VALUES('43', 'UE', '43-44')
insert into @Temp(Namn, Beskrivning, Grupp) VALUES('44', 'UE', '43-44')
insert into @Temp(Namn, Beskrivning, Grupp) VALUES('45', 'Installationer', '45')
SELECT kgt.Namn AS KontoNr, kgt.Beskrivning AS Typ, kgt.Grupp as Kontor, k.Privat,
SUM(CASE LEFT(ko.KontoNr, 1) WHEN '3' THEN 0 WHEN '9' THEN 0 ELSE tb.Belopp END) AS [Sum],
CASE WHEN k.PrivatPerson = 1 THEN 'Konsument' ELSE isnull(k.Namn,'Kund saknas') END AS kundnamn
FROM Table1 tb
LEFT OUTER JOIN Table2 AS ko ON tb.KontoId = ko.Id
LEFT OUTER JOIN @KontoGruppTemp kgt on
case
when LEN(kgt.Namn) = 3
then CONVERT(INT, (LEFT(ko.KontoNr, 3)))
else
CONVERT(INT, (LEFT(ko.KontoNr, 2)))
end
= kgt.Namn
LEFT OUTER JOIN Aktivitet AS a ON tb.AktivitetId = a.Id
LEFT OUTER JOIN AktivitetKund AS ak ON a.Id = ak.AktivitetId AND ak.ValdUppfoljning = 1
LEFT OUTER JOIN Kund AS k ON ak.KundId = k.Id
LEFT OUTER JOIN KundForetag AS kf ON k.Id = kf.KundId
LEFT OUTER JOIN Projekt p on p.Id = tb.ProjektId
WHERE a.ProjektId IN (@ProjektId)
AND kgt.Beskrivning IS NOT NULL
AND tb.Datum >= @FranDatum
AND tb.Datum <= @TillDatum
AND p.BasenStatus IN(1,2)
GROUP BY k.Namn, kgt.Namn, kgt.Beskrivning, k.PrivatPerson, kgt.Grupp
order by kgt.Namn, kgt.Grupp
Any ideas
Hi,
we are new on Telerik Reporting, basically in this moment we are testing the tool and try to decide if we replace SSRS. we are using the Telerik MVC Reportviewer for ASP.NET MVC (Reporting R3 2016) and we set a couple elements configuration in order to use this tool, everything looks good (apparently), but when the application host calls the ReportViewer and try to render the content, nothing happen, basically the report viewer control is showed but the content inside it not.
Here our configuration:
1. DAO Object:
[DataObject]
public class DIAS_FESTIVO : BASE
{
public int ID_FESTIVIDAD { get; set; }
public string EVENTO_FESTIVO { get; set; }
public string FECHA_FESTIVIDAD { get; set; }
public bool ES_DIA_HABIL { get; set; }
public DIAS_FESTIVO(string strConexion, string strNombreApp)
{
this.strConexion = strConexion;
this.strNombreApp = strNombreApp;
}
public DIAS_FESTIVO()
{
}
[DataObjectMethod(DataObjectMethodType.Select)]
public List<DIAS_FESTIVO> getListDIAS_FESTIVOS()
{
List<DIAS_FESTIVO> DIAS_FESTIVOS = new List<DIAS_FESTIVO>();
DataTable dt = new DataTable();
try
{
strConexion = "Data Source=XXXX;User ID=XXX;Password=YYYY;Unicode=True";
Database db = new Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase(strConexion);
OracleDbType cursor = OracleDbType.RefCursor;
DataSet oDataSet = db.ExecuteDataSet("MI_PKG.ObtenerDiasFestivos", cursor);
dt = oDataSet.Tables[0];
//On this point the data has been extracted, we have debugged this part and see the information, after the query is solved we convert the datatable into collection
DIAS_FESTIVOS = DataTableToList<DIAS_FESTIVO>(dt);
}
catch (Exception ex)
{
throw ex;
}
return DIAS_FESTIVOS;
}
}
2. We set a Custom Report Resolver class in order to handle the request to fill the report datasource, here is:
public class CustomReportResolver : Telerik.Reporting.Services.Engine.IReportResolver
{
public Telerik.Reporting.ReportSource Resolve(string reportId)
{
ObjectDataSource oDs = new ObjectDataSource();
oDs.DataSource = typeof(DIAS_FESTIVO); //Indicate the collection to use
oDs.DataMember = "getListDIAS_FESTIVOS"; //the method to extract the collection on the point #1
oDs.Name = "Report1.trdp"; //This is the name of the report, previously created on the Telerik Report designer
Report rpt = new Report();
rpt.DataSource = oDs;
rpt.Name = "Report1.trdp";
rpt.Visible = true;
return new Telerik.Reporting.InstanceReportSource { ReportDocument = rpt };
}
}
3. On View cshtml (partial view)
@model Telerik.Reporting.ReportSource
@using NEW
<style>
#reportViewer1 {
position: relative;
width: auto;
height: 500px;
font-family: Verdana, Arial;
}
</style>
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl(Url.Content("/api/reports"))
.ReportSource("1")
.ViewMode(ViewMode.Interactive)
.ScaleMode(ScaleMode.Specific)
.Scale(1.0)
.PersistSession(false)
.PrintMode(PrintMode.AutoSelect)
)
4. WebConfig file in application host has been set,
<configSections>
<section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" />
</configSections>
<Telerik.Reporting>
<assemblyReferences>
<add name="DAO" version="1.0.0.1"/>
</assemblyReferences>
</Telerik.Reporting>
DAO is the project class c# you see in the point #1
Please see the attached image: ReportViewer_Loaded.png in order to see the result when the page has been loaded. I am pretty sure that the code into DAO object is executed when the application is running because we debugged that part, but I suspect the problem is when we try to bind the template dataset into report with the datasource (dataset included) passed as parameter (I mean the collection object as you see in the point #1) because when we test the template report (Report1.trdp) from Telerik Report design the data appear, in that moment the connection is directly on oracle database.
Please your help,
Many Thanks,
I have a report with about 30 sections that may or may not be displayed depending on choices made by the user. Each section is in a panel that is initially set to not display (visible = false). The panels are stacked up on the page with no space between them and are the full width of the page. At run time I problematically shrink them all to 1px tall and move them to the top of the report with each panel having its top 1px below the preceding one. The ones that the user wants to have printed are set to be visible at run time. Normally this works great and each panel expands to fit it's content and the panels below it are pushed down. But, occasionally certain combinations of panels will overlap each other. There are only a few that do this, but they do it consistently. In one case they are adjacent panels and in the other cases they are separated by a few panels that are still invisible.
Any advice on this problem?
Thanks,
John
I was using telerik reporting to generate reports but they was some problems with rendering performance. Due to large number of records and each record have several images. It takes too much time to render the report and when i scrolled up and down, it doesn't smooth. Is there any suggestion to improve the performance or decrease the render time. You can see the example report in an attach file.
Thank you.
Hello,
it's possible load a dataset to report in HTML5 Report Viewer from codebehind?
I'm search for this information but i can't find nothing.
In my application i have a aspx with HTML5 Report Viewer and a Report.vb, the report vb contains into a dataset with 3 datatables, but i can't load the data to these dataset.
PD: sorry if my english is a little bad, i speak a little english.
Thank you for your attention and help
Hi have a requirement to generate a grid of photos.
I have managed to get the data in the shape where this can be grouped in a cross-tab. The photos I need to bind to have a filename of {id}.jpg in a known folder. I have created a user function that accepts the Fields.Id, retrieves this photo and returns an image (this is a technique I've used before successfully).
I have added a picturebox into the detail of the crosstab, but whenever I go to bind the "value" of the picturebox to the user function, Visual Studio crashes. Stack trace below. I suspect as this is in the detail it's trying to apply some aggregate to it. Are there any workarounds to do this binding at runtime to get around this designer bug?
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
Server stack trace:
at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
at Telerik.Reporting.Design.Common.Utils.AggregateFunctionHelper.GetAggregateFunctions(IServiceProvider provider)
at Telerik.Reporting.Design.Common.ExpressionBuilder.CategoryAdapter.<GetAggregates>d__28.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at Telerik.Reporting.Design.Common.ExpressionBuilder.CategoryAdapter.FillAggregates(Category funcCategory, IServiceProvider provider)
at Telerik.Reporting.Design.Common.ExpressionBuilder.CategoryAdapter.CreateHierarchy(IServiceProvider provider, Boolean isFieldsTreeVisible)
at Telerik.Reporting.Design.Common.ExpressionBuilder.ExpressionBuilderDialog.LoadCategories(IServiceProvider provider)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(System.Runtime.Remoting.Messaging.Message, Boolean)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(System.Object, System.Runtime.Remoting.Proxies.MessageData ByRef)
at Telerik.Reporting.Design.Common.ExpressionBuilder.ExpressionBuilderDialog+LoadCategoriesDelegate.EndInvoke(System.IAsyncResult)
Is there a way to define multiple color palette for a same bar series and based on the parameters selected by user the graph shall automatically pick appropriate color palette for the series?
I am struggling to make our pie charts look good and be useful -- here are the two issues (somewhat related):
Are there solutions to these two items?
Ok, I have a report that is set to TextAlign = Justify.
I have a text box in the report that is set to TextAlign = Left. The text in the text box wraps to a second line.
When I run the report, the text is Justified, not aligned left, as specified for the text box.
Is this a bug, or does the TextAlign at the report level over-ride the alignment set at the text box level?
I've included screenshots that demonstrate this.
Thanks!