Servicestack as SSRS datasource - reporting-services

I am trying to use servicestack as a datasource for my SSRS report. Is this possible? Right now I have a simple operation that takes a date as a parameter, looks like this in C#
[DataContract]
[Route("/Reports/SummaryBySymbol/{SummaryDate}", Summary = "Summarizes trades by symbol for a specific date.")]
public class GetTradesGroupedBySymbol : IReturn<TradesGroupedBySymbolResponse>
{
[DataMember]
[ApiMember(Name = "Summary Date",
Description = "The date for which the trades will be summarized..",
DataType = "DateTime",
IsRequired = true)]
public DateTime SummaryDate { get; set; }
}
[DataContract]
public class TradesGroupedBySymbolResponse
{
[DataMember] public IList<SymbolSummary> Result { get; set; }
}
I am trying to create a dataset in SSRS using: http://machineName:port/soap11
as the datasource.
When the dataset asks for a query, I have no idea what to enter as text and the examples I can find always cause the interface to freeze when I hit the 'next' button (so I must assume I entered something incorrectly).
Here is what I tried to enter as the query:
<Query>
<Method Namespace="http://www.company.com/types" Name="GetTradesGroupedBySymbol" />
<SoapAction>
http://www.company.com/types/GetTradesGroupedBySymbol
</SoapAction>
<Parameters>
<Parameter Name="SummaryDate" Type="XML"/>
</Parameters>
<ElementPath IgnoreNamespaces="True">
GetTradesGroupedBySymbolResponse{}/Result{}/SymbolSummary
</ElementPath>
</Query>
Here is the wsdl for the service:
<wsdl:definitions xmlns:svc="http://www.company.com/types" xmlns:tns="http://www.company.com/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" name="Soap11" targetNamespace="http://www.company.com/types">
<wsdl:types>
<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType"/>
<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
<xs:element name="boolean" nillable="true" type="xs:boolean"/>
<xs:element name="byte" nillable="true" type="xs:byte"/>
<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
<xs:element name="decimal" nillable="true" type="xs:decimal"/>
<xs:element name="double" nillable="true" type="xs:double"/>
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="QName" nillable="true" type="xs:QName"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="string" nillable="true" type="xs:string"/>
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
<xs:element name="char" nillable="true" type="tns:char"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
</xs:schema>
<xs:schema xmlns:tns="http://www.company.com/types" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.company.com/types">
<xs:complexType name="GetTradesGroupedBySymbol">
<xs:sequence>
<xs:element minOccurs="0" name="SummaryDate" type="xs:dateTime"/>
</xs:sequence>
</xs:complexType>
<xs:element name="GetTradesGroupedBySymbol" nillable="true" type="tns:GetTradesGroupedBySymbol"/>
<xs:complexType name="GetTradesGroupedBySymbolResponse">
<xs:sequence>
<xs:element minOccurs="0" name="Result" nillable="true" type="tns:ArrayOfSymbolSummary"/>
</xs:sequence>
</xs:complexType>
<xs:element name="GetTradesGroupedBySymbolResponse" nillable="true" type="tns:GetTradesGroupedBySymbolResponse"/>
<xs:complexType name="ArrayOfSymbolSummary">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="SymbolSummary" nillable="true" type="tns:SymbolSummary"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfSymbolSummary" nillable="true" type="tns:ArrayOfSymbolSummary"/>
<xs:complexType name="SymbolSummary">
<xs:sequence>
<xs:element minOccurs="0" name="BuyQuantityFilled" type="xs:int"/>
<xs:element minOccurs="0" name="BuyTotalValue" type="xs:double"/>
<xs:element minOccurs="0" name="BuyWeightedAveragePrice" type="xs:double"/>
<xs:element minOccurs="0" name="CompanyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="SellQuantityFilled" type="xs:int"/>
<xs:element minOccurs="0" name="SellTotalValue" type="xs:double"/>
<xs:element minOccurs="0" name="SellWeightedAveragePrice" type="xs:double"/>
<xs:element minOccurs="0" name="Ticker" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="SymbolSummary" nillable="true" type="tns:SymbolSummary"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="GetTradesGroupedBySymbolIn">
<wsdl:part name="par" element="tns:GetTradesGroupedBySymbol"/>
</wsdl:message>
<wsdl:message name="GetTradesGroupedBySymbolOut">
<wsdl:part name="par" element="tns:GetTradesGroupedBySymbolResponse"/>
</wsdl:message>
<wsdl:portType name="ISyncReply">
<wsdl:operation name="GetTradesGroupedBySymbol">
<wsdl:input message="svc:GetTradesGroupedBySymbolIn"/>
<wsdl:output message="svc:GetTradesGroupedBySymbolOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_ISyncReply" type="svc:ISyncReply">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetTradesGroupedBySymbol">
<soap:operation soapAction="http://www.company.com/types/GetTradesGroupedBySymbol" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SyncReply">
<wsdl:port name="BasicHttpBinding_ISyncReply" binding="svc:BasicHttpBinding_ISyncReply">
<soap:address location="http://serverName:port/soap11"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I would expect the query to ask me for a parameter before attempting to run the soapAction (or at least error out), but the interface just locks up and I have to kill Visual Studio. Any ideas out there as to what I am doing wrong?
EDIT 1
Modified the above query and wsdl to show latest attempts to get this to work. VS still freezes.

It appears that the problem was the long running webservice response causing a connection time out in the wizard and causing the entire VS2017 environment to freeze (not optimal behavior). Once I created a dummy version of the webservice that responds with the same DTO and couple of dummy rows but that returned in less than a second, everything worked. The report was generated and I could then go in to the dataset, change the timeout to be 2 minutes and then changed the query to point back to the real web method and it worked as expected.
As a follow up detail, if you are passing a date to ServiceStack, use the 'String' data type (not XML) and ensure that the date format is yyyy-mm-dd (months and days must be padded with zeros if they are single digit values).

Related

tag validation in XSD File

Someone knows, how to implement the following validate in the XSD file:
When the tag TIPO has the value SER, it is mandatory to register the tag DETALLES_SERVICIOS otherwise if the value is EQU, it is optional
I am using the XSD version 1.0 and I can not implement a way to do this validation.
Thanks in advance for the help.
XML
<REQUERIMIENTO>
<DETALLES_SOLICITUDES>
<ID_PLAN>BP-7138</ID_PLAN>
<ID_SUBPRODUCTO>AUT</ID_SUBPRODUCTO>
<CANTIDAD>1</CANTIDAD>
<TIPO>SER</TIPO>
<DETALLES_SERVICIOS>
<NOMBRE_USUARIO>JANIO</NOMBRE_USUARIO>
<NUMERO_SERIE>12345</NUMERO_SERIE>
<IN_BODEGA>130</IN_BODEGA>
</DETALLES_SERVICIOS>
</DETALLES_SOLICITUDES>
<DETALLES_SOLICITUDES>
<ID_PLAN>0</ID_PLAN>
<ID_SUBPRODUCTO>SAMSUNG A510 G</ID_SUBPRODUCTO>
<CANTIDAD>1</CANTIDAD>
<TIPO>EQU</TIPO>
</DETALLES_SOLICITUDES>
</REQUERIMIENTO>
XSD
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="REQUERIMIENTO">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="DETALLES_SOLICITUDES">
<xs:complexType>
<xs:sequence>
<xs:element name="ID_PLAN" type="xs:string" />
<xs:element name="ID_SUBPRODUCTO" type="xs:string" />
<xs:element name="CANTIDAD" type="xs:string" />
<xs:element name="TIPO">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="SER"/>
<xs:enumeration value="EQU"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="DETALLES_SERVICIOS">
<xs:complexType>
<xs:sequence>
<xs:element name="NOMBRE_USUARIO" type="xs:string" />
<xs:element name="NUMERO_SERIE" type="xs:unsignedShort" />
<xs:element name="IN_BODEGA" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
It is not possible to implement this in XSD-1.0, but if you find a way to use XSD-1.1, you can use the following xs:assert expression after your second xs:sequence element:
<xs:assert test="((TIPO = 'SER') and DETALLES_SERVICIOS) or (TIPO='EQU')" />
EDIT: thx to #MichaelKay to make sure that it isn't possible at all.

XML validation using XSD failing [duplicate]

This is my sample XML code:
<Address>
<StreetAddress></StreetAddress>
<OtherDestination />
<City>TORONTO</City>
</Address>
That is currently using this XSD:
<xs:element name="Address" nillable="true">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element ref="StreetAddress" minOccurs="0"/>
<xs:element ref="OtherDestination" minOccurs="0"/>
<xs:element ref="City" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
I want to add an attribute id to Address element like this..
<Address id="first">
<StreetAddress></StreetAddress>
<OtherDestination />
<City>TORONTO</City>
</Address>
How should I change the existing XSD to fulfill my requirement?
An attribute declaration can be added within xs:complexType after the xs:sequence:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="StreetAddress" minOccurs="0" type="xs:string"/>
<xs:element name="OtherDestination" minOccurs="0" type="xs:string"/>
<xs:element name="City" minOccurs="0" type="xs:string"/>
</xs:sequence>
<!------------------------------------------>
<!-- This is where to declare attributes: -->
<xs:attribute name="id" type="xs:string"/>
<!------------------------------------------>
</xs:complexType>
</xs:element>
</xs:schema>
The above XSD will validate your XML successfully.

how to convert Json array to XSD

I am currently mapping Json and XSD.
In Json there is array contains several items with same elements.
the Json array is like:
"Item":[
{
"ItemSequenceNo":0,
"AQuantity":{
"code":"aaa",
"quantity":1
},
"DQuantity":{
"code":"ddd",
"quantity":4
},
"Amount":{
"currencyID":"USD",
"value":111
},
},
{
"ItemSequenceNo":1,
"AQuantity":{
"code":"aaa",
"quantity":4
},
"DQuantity":{
"code":"ddd",
"quantity":9
},
"Amount":{
"currencyID":"USD",
"value":123
},
}
]
I tried to map this Json array with XSD:
<xs:element name="Item">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="50">
<xs:element ref="p:ItemSequenceNo" minOccurs="1" maxOccurs="1"/>
<xs:element ref="p:AQuantity" minOccurs="1" maxOccurs="1"/>
<xs:element ref="p:DQuantity" minOccurs="1" maxOccurs="1"/>
<xs:element ref="p:Amount" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
where the ref is like:
<xs:element name="ItemSequenceNo">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AQuantity">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="code">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="DQuantity">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="code">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Amount">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="CurrencyID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
The thing is when I am mapping Json array with XSD, the output XML ordered by array item(elements) like below:
<item>
<ItemSequenceNo >0</ItemSequenceNo>
<ItemSequenceNo >1</ItemSequenceNo>
<AQuantity code="aaa">1</AQuantity>
<AQuantity code="aaa">4</AQuantity>
<DQuantity code="ddd">4</DQuantity>
<DQuantity code="ddd">9</DQuantity>
<Amount CurrencyID="USD">111</Amount>
<Amount CurrencyID="USD">123</Amount>
</item>
while the result I am expecting is two separate blocks:
<item>
<ItemSequenceNo >0</ItemSequenceNo>
<AQuantity code="aaa">1</AQuantity>
<DQuantity code="ddd">4</DQuantity>
<Amount CurrencyID="USD">111</Amount>
</item>
<item>
<ItemSequenceNo >1</ItemSequenceNo>
<AQuantity code="aaa">4</AQuantity>
<DQuantity code="ddd">9</DQuantity>
<Amount CurrencyID="USD">123</Amount>
</item>
Does anyone have any idea on how can I get this? By modifying Json/XSD, or is there any function in MapForce that could achieve this?
You already solved it, as you said in your comment, but for people who are coming here with the same problem, looking for a solution, it would be nice to provide an answer here.
It may be a bit counterintuitive, that in MapForce you don't draw the line from the Item-Array in the JSON input to the Item node in the XML output. If you do so, you'll get the unified output that BOSubuntu has described. Instead, you draw the line from the objects that the array contains (see picture below, line marked in red). This would give the desired output.

xsd substitution or xlt transformation

How Do I Change this XSD using substitution to get the following outcome?
I have a XML that is being returned from my asp.net API from a Saas providor. The service comes from asp.net mvc however, I can only use asp classic, and i'm pretty limited in what i can do. I can send TSQL queries to the SQL server 2005... Other than that there's not much that can be done. So my only option for what i need (well my best current option) is this. The data returns from my asp classic page service.asp. service.asp returns the structured xml based off an XSD file that is in the same folder as my script to get the data. I'll show you what it currently returns, what the current xsd is, and what it should return, and the modifications I tried making to the XSD. Hopefully that's the info someone will need to help me as this isn't exactly my strong suite. Thanks!
Current XML Response
Currently the data returns like this:
<xmldata>
<group>
<groupid>1</groupid>
<parentid>2</parentid>
<item>133</item>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
</group>
<group>
<groupid>2</groupid>
<parentid>2</parentid>
<item>134</item>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
</group>
<group>
<groupid>2</groupid>
<parentid>2</parentid>
<item>313</item>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
</group>
<group>
<groupid>3</groupid>
<parentid>2</parentid>
<item>46</item>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
</group>
</xmldata>
Current XSD File
My current XSD File is structured as follows:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="xmldata" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
<xs:element name="xmldata" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="groups">
<xs:complexType>
<xs:sequence>
<xs:element msprop:TableNameXsd="groupid" name="groupid" msprop:SqlDbType="Int" msprop:IsIdentity="true" minOccurs="0" />
<xs:element name="ParentID" msprop:SqlDbType="Int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="groupproductlink">
<xs:complexType>
<xs:sequence>
<xs:element msprop:TableNameXsd="groupproductlink" name="ID" msprop:SqlDbType="Int" msprop:IsIdentity="true" minOccurs="0" />
<xs:element name="groupID" msprop:SqlDbType="Int" minOccurs="0" />
<xs:element name="ProductCode" msprop:SqlDbType="Int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Products">
<xs:complexType>
<xs:sequence>
<xs:element msprop:TableNameXsd="Products" name="AutoDropShip" msprop:maxLength="1" msprop:SQLTableAlias="p" msprop:SqlDbType="VarChar" msprop:SQLFrom="FROM vm.Products p INNER JOIN vm.Products_Descriptions pd ON p.ProductCode = pd.ProductCode INNER JOIN vm.PE pe ON p.ProductCode = pe.ProductCode INNER JOIN vm.Products_Memos pm ON p.ProductCode = pm.ProductCode" minOccurs="0" />
<xs:element name="productid" msprop:maxLength="30" msprop:SQLTableAlias="p" msprop:SqlDbType="VarChar" minOccurs="1" />
<xs:element name="ProductCode" msprop:SQLTableAlias="p" msprop:SqlDbType="Int" msprop:IsIdentity="true" minOccurs="0" />
<xs:element name="ProductName" msprop:maxLength="255" msprop:SQLTableAlias="p" msprop:SqlDbType="VarChar" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
What the XML Should Be
The XML Needs to be returned in the following way (please note the attribute becoming the element)
<groups>
**<1> //<---Element=groupID**
<item>133</item>
<parentid>2</parentid>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
**</1> //<---Element=groupID
<2> //<---Element=groupID**
<item>134</item>
<parentid>2</parentid>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
**</2> //<---Element=groupID
<2> //<---Element=groupID**
<item>313</item>
<parentid>2</parentid>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>e="1">
**</2> //<---Element=groupID
<3> //<---Element=groupID**
<item>46</item>
<parentid>2</parentid>
<ProductCode>blahblah</ProductCode>
<ProductName>blahblah</ProductName>
**</3> //<---Element=groupID**
</groups>
The XSD I attempted to use and didn't get any response
I tried transforming the XSD that I listed above to the following:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="groups" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
**<xs:element name="groups" *msdata:IsDataSet="true"* msdata:UseCurrentLocale="true">**
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="groupid" *msdata:IsDataSet="true"* msdata:UseCurrentLocale="true" msprop:TableNameXsd="groupid" msprop:SqlDbType="Int" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element msprop:TableNameXsd="groupid" name="groupid" msprop:SqlDbType="Int" msprop:IsIdentity="true" minOccurs="0" />
<xs:element name="ParentID" msprop:SqlDbType="Int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="groupproductlink">
<xs:complexType>
<xs:sequence>
<xs:element msprop:TableNameXsd="groupproductlink" name="ID" msprop:SqlDbType="Int" msprop:IsIdentity="true" minOccurs="0" />
<xs:element name="groupID" msprop:SqlDbType="Int" minOccurs="0" />
<xs:element name="ProductCode" msprop:SqlDbType="Int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Products">
<xs:complexType>
<xs:sequence>
<xs:element msprop:TableNameXsd="Products" name="AutoDropShip" msprop:maxLength="1" msprop:SQLTableAlias="p" msprop:SqlDbType="VarChar" msprop:SQLFrom="FROM vm.Products p INNER JOIN vm.Products_Descriptions pd ON p.ProductCode = pd.ProductCode INNER JOIN vm.PE pe ON p.ProductCode = pe.ProductCode INNER JOIN vm.Products_Memos pm ON p.ProductCode = pm.ProductCode" minOccurs="0" />
<xs:element name="productid" msprop:maxLength="30" msprop:SQLTableAlias="p" msprop:SqlDbType="VarChar" minOccurs="1" />
<xs:element name="ProductCode" msprop:SQLTableAlias="p" msprop:SqlDbType="Int" msprop:IsIdentity="true" minOccurs="0" />
<xs:element name="ProductName" msprop:maxLength="255" msprop:SQLTableAlias="p" msprop:SqlDbType="VarChar" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
However,
It doesn't work currently. I think maybe I need to use a substitution group, however unfortunately it's been years since I did this and I can't remember what exactly I need to do. I truly hope someone here has some better ideas!

Dynamically create crystal report columns

I have created a cross tab report to create a report dynamically according to the user's selected column.
But I have got a serious problem, I wanna want to hide other fields when those fields are empty (no data to show).
The schema for that report:
<xs:element name="salseSummary">
<xs:complexType>
<xs:sequence>
<xs:element name="A1" type="xs:string"></xs:element>
<xs:element name="A2" type="xs:string"></xs:element>
<xs:element name="A3" type="xs:string"></xs:element>
<xs:element name="A4" type="xs:string"></xs:element>
<xs:element name="A5" type="xs:string"></xs:element>
<xs:element name="A6" type="xs:string"></xs:element>
<xs:element name="A7" type="xs:string"></xs:element>
<xs:element name="A8" type="xs:string"></xs:element>
<xs:element name="A9" type="xs:string"></xs:element>
<xs:element name="A10" type="xs:string"></xs:element>
<xs:element name="A11" type="xs:string"></xs:element>
<xs:element name="A12" type="xs:string"></xs:element>
<xs:element name="A13" type="xs:string"></xs:element>
<xs:element name="A14" type="xs:string"></xs:element>
<xs:element name="A15" type="xs:string"></xs:element>
<xs:element name="A16" type="xs:string"></xs:element>
<xs:element name="A17" type="xs:string"></xs:element>
<xs:element name="A18" type="xs:string"></xs:element>
<xs:element name="A19" type="xs:string"></xs:element>
<xs:element name="A20" type="xs:string"></xs:element>
<xs:element name="TOTAL" type="xs:decimal"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Here is the way how I map those columns to the report
This is how I set the custom styles
But when I run it, this is how it displays the result.
You don't need to have the same fields in both the rows and columns sections--choose one.