EDN Admin
Well-known member
I have code that will get the values of an RDL.
I have done this successfully for one RDL. In another RDL, that is a bit different, it gives me the hexadecimal error.
Im not entirely sure why I am getting this error since it worked in my "simple" RDL.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; public <span style="color:Blue; static <span style="color:Blue; void GetRDLParameters(<span style="color:Blue; byte[] reportDefinition)
{
<span style="color:Green; //Get the report definition namespace from app.config
<span style="color:Blue; string reportDefinitionNameSpace = ConfigurationManager.AppSettings[ReportServiceConstants.ReportDefinitionNameSpace];
MemoryStream definitionStream = <span style="color:Blue; new MemoryStream(reportDefinition);
XElement x;
x = XElement.Load(definitionStream);
<span style="color:Green; // Get data sets.
<span style="color:Blue; var dataSetElements = x.Descendants(reportDefinitionNameSpace + <span style="color:#A31515; "DataSet");
<span style="color:Green; //Lopo through each dataset to get the name of the dataset
<span style="color:Blue; foreach (XElement dataSetElement <span style="color:Blue; in dataSetElements)
{
...DO STUFF HERE
}
}
[/code]
It says that the ":" character is in line 5 when I look at the exception.
Here is a short snippet of the XML:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Report <span style="color:Red; xmlns:rd<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/SQLServer/reporting/reportdesigner<span style="color:Black; " <span style="color:Red; xmlns:cl<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition<span style="color:Black; " <span style="color:Red; xmlns<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AutoRefresh<span style="color:Blue; >0<span style="color:Blue; </<span style="color:#A31515; AutoRefresh<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSources<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSource <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; dsrcDataWarehouse<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSourceReference<span style="color:Blue; >dsrcsharedDataWarehouse<span style="color:Blue; </<span style="color:#A31515; DataSourceReference<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; SecurityType<span style="color:Blue; >None<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; SecurityType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; DataSourceID<span style="color:Blue; >e1b77cb2-fe8d-46f9-b8d7-9192cd4454ab<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; DataSourceID<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DataSource<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DataSources<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSets<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSet <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; dsetGetPeriodEndDates<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SharedDataSet<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SharedDataSetReference<span style="color:Blue; >dsetsharedGetPeriodEndDates<span style="color:Blue; </<span style="color:#A31515; SharedDataSetReference<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; QueryParameters<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; QueryParameter <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; @PublishedOnly<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Value<span style="color:Blue; >1<span style="color:Blue; </<span style="color:#A31515; Value<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; QueryParameter<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; QueryParameters<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; SharedDataSet<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Fields<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Field <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; PeriodEndDate<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataField<span style="color:Blue; >PeriodEndDate<span style="color:Blue; </<span style="color:#A31515; DataField<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >System.DateTime<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Field<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Field <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Period_Code<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataField<span style="color:Blue; >Period_Code<span style="color:Blue; </<span style="color:#A31515; DataField<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >System.Int32<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Field<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Fields<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DataSet<span style="color:Blue; >
[/code]
Im a bit stumped b/c I dont think I see a ":" in line 5. Theoretically nothing else changed from my "simplistic" RDL.
Have I missed something that I should have taken into account?
Thanks.
View the full article
I have done this successfully for one RDL. In another RDL, that is a bit different, it gives me the hexadecimal error.
Im not entirely sure why I am getting this error since it worked in my "simple" RDL.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; public <span style="color:Blue; static <span style="color:Blue; void GetRDLParameters(<span style="color:Blue; byte[] reportDefinition)
{
<span style="color:Green; //Get the report definition namespace from app.config
<span style="color:Blue; string reportDefinitionNameSpace = ConfigurationManager.AppSettings[ReportServiceConstants.ReportDefinitionNameSpace];
MemoryStream definitionStream = <span style="color:Blue; new MemoryStream(reportDefinition);
XElement x;
x = XElement.Load(definitionStream);
<span style="color:Green; // Get data sets.
<span style="color:Blue; var dataSetElements = x.Descendants(reportDefinitionNameSpace + <span style="color:#A31515; "DataSet");
<span style="color:Green; //Lopo through each dataset to get the name of the dataset
<span style="color:Blue; foreach (XElement dataSetElement <span style="color:Blue; in dataSetElements)
{
...DO STUFF HERE
}
}
[/code]
It says that the ":" character is in line 5 when I look at the exception.
Here is a short snippet of the XML:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Report <span style="color:Red; xmlns:rd<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/SQLServer/reporting/reportdesigner<span style="color:Black; " <span style="color:Red; xmlns:cl<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition<span style="color:Black; " <span style="color:Red; xmlns<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AutoRefresh<span style="color:Blue; >0<span style="color:Blue; </<span style="color:#A31515; AutoRefresh<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSources<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSource <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; dsrcDataWarehouse<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSourceReference<span style="color:Blue; >dsrcsharedDataWarehouse<span style="color:Blue; </<span style="color:#A31515; DataSourceReference<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; SecurityType<span style="color:Blue; >None<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; SecurityType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; DataSourceID<span style="color:Blue; >e1b77cb2-fe8d-46f9-b8d7-9192cd4454ab<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; DataSourceID<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DataSource<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DataSources<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSets<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataSet <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; dsetGetPeriodEndDates<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SharedDataSet<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SharedDataSetReference<span style="color:Blue; >dsetsharedGetPeriodEndDates<span style="color:Blue; </<span style="color:#A31515; SharedDataSetReference<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; QueryParameters<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; QueryParameter <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; @PublishedOnly<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Value<span style="color:Blue; >1<span style="color:Blue; </<span style="color:#A31515; Value<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; QueryParameter<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; QueryParameters<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; SharedDataSet<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Fields<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Field <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; PeriodEndDate<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataField<span style="color:Blue; >PeriodEndDate<span style="color:Blue; </<span style="color:#A31515; DataField<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >System.DateTime<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Field<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Field <span style="color:Red; Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Period_Code<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DataField<span style="color:Blue; >Period_Code<span style="color:Blue; </<span style="color:#A31515; DataField<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >System.Int32<span style="color:Blue; </<span style="color:#A31515; rd<span style="color:Blue; :<span style="color:#A31515; TypeName<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Field<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Fields<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DataSet<span style="color:Blue; >
[/code]
Im a bit stumped b/c I dont think I see a ":" in line 5. Theoretically nothing else changed from my "simplistic" RDL.
Have I missed something that I should have taken into account?
Thanks.
View the full article