Generate RDL Using XSDObjectGen XSD.EXE XMLTextWriter Or XSLT...
Mar 14, 2006
I'm writing some code to generate RDL based on a set of existing tables that define reports. (Headings, columns etc.)
The options I'm exploring so far for doing this are as follows:
Use XMLTextWriter class
Use XMLDocument class
Use XMLSerialiser to serialse a set of classes made with XSD.EXE and
Use XMLSerialiser to serialse a set of classes made with XSDObjectGen
Use XSLT to convert MyReportDefinitionDataset.GetXML into RDL
Has anybody else out there seen other code that does anything like this or in general has any suggestions to help me narrow these options down?
Note:
I am hoping to allow users supplying RDL their own files as templates enabling them to define things like report header and footer etc.
My code will take the Table element from the template RDL and replace it with my generated XML (Headings and columns etc.)
Any suggestions/help/existing sample code appreciated.
Thanks,
Mike G
View 4 Replies
ADVERTISEMENT
Jun 14, 1999
I want to delete and recreate the master Database Device for purpose of shrinking the size of the device .
I dont want to loose the Master db.
I thought of transfering the Master db to a different device,
Delete and recreate the master device and then tranfer back the master db .
and this is all done through the MS SQL enterprise Manager (SQL 6.5 )
Is this the safest eay to proceed with this task?
Any thoughts are greatly appreciated.
Thank you
Guss Hasb
View 1 Replies
View Related
Feb 23, 2007
Can I use the XML task in SSIS to create an excel document? If so which operation type is best to do it with, XSLT?
I'm trying create excel files dynamically with nothing more than a SQL statement that I'm passing as a variable which generates XML. I would then like to take that variable and combine it with a template and create an excel document. Any help would be appreciated. I do not want to use the data flow because it requires all transformations ahead of time.
Thanks,
Phil
View 3 Replies
View Related
Sep 10, 2007
Hi,
I've got an xml and an xslt - I want to get that into reporting services. Right now I have a link to the xml file in a 'report', which will open it correctly and format with the xslt. I'd like it to display without going to an external link.
I know how to use an xml datasource, but I need the xslt applied, since it has some nice formatting in it - so i don't think that will work.
I'm trying to report on the results of a scripted ms baseline security analyzer of several servers - the style sheet lets you drill down and has links to the base reports.
Thanks for your help.
View 4 Replies
View Related
Mar 3, 2008
Hi,
I've got a problem with my ssis package.
I have a webservice, which from i am downloading xml file which looks like this:
Code Snippet
<?xml version="1.0" encoding="utf-16"?>
<DataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="lukas_id_nagrody" type="xs:string" minOccurs="0" />
<xs:element name="ilosc" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet>
<Table diffgr:id="Table1" msdata:rowOrder="0">
<lukas_id_nagrody>10</lukas_id_nagrody>
<ilosc>4</ilosc>
</Table>
<Table diffgr:id="Table2" msdata:rowOrder="1">
<lukas_id_nagrody>12</lukas_id_nagrody>
<ilosc>10</ilosc>
</Table>
<Table diffgr:id="Table3" msdata:rowOrder="2">
<lukas_id_nagrody>21</lukas_id_nagrody>
<ilosc>32</ilosc>
</Table>
<Table diffgr:id="Table4" msdata:rowOrder="3">
<lukas_id_nagrody>32</lukas_id_nagrody>
<ilosc>13</ilosc>
</Table>
<Table diffgr:id="Table5" msdata:rowOrder="4">
<lukas_id_nagrody>33</lukas_id_nagrody>
<ilosc>15</ilosc>
</Table>
<Table diffgr:id="Table6" msdata:rowOrder="5">
<lukas_id_nagrody>34</lukas_id_nagrody>
<ilosc>2</ilosc>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>
And i want it to looks like this:
Code Snippet
<?xml version="1.0" encoding="utf-16"?>
<DataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="lukas_id_nagrody" type="xs:string" minOccurs="0" />
<xs:element name="ilosc" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table id="Table1" rowOrder="0">
<lukas_id_nagrody>J07Z0</lukas_id_nagrody>
<ilosc>1</ilosc>
</Table>
<Table id="Table2" rowOrder="1">
<lukas_id_nagrody>J08Z0</lukas_id_nagrody>
<ilosc>1</ilosc>
</Table>
<Table id="Table3" rowOrder="2">
<lukas_id_nagrody>J09Z0</lukas_id_nagrody>
<ilosc>1</ilosc>
</Table>
</DataSet>
Can You help me?
Thanks in advance
ps. sorry for my english
View 4 Replies
View Related
Sep 10, 2007
Hi,
I've a xml file and I want to substitute some of the values from database in this xml using XSLT transformation making use of XML task. How can this be achieved?
Thanks
View 5 Replies
View Related
Jun 15, 2006
I have an XSLT transform that works perfectly using the msxsl.exe utility.
When the same XSL file is run through an SSIS XML transform, the character spacing and carriage returns embedded in the XSL templates are mostly (but not completely) dropped.
Any comments on why SSIS is behaving differently than msxsl.exe? What to do?
Thanks in advance,
Richard
View 4 Replies
View Related
Aug 10, 2006
In the XML Task if you set the OperationType to XSLT, how do you pass arguments to the Transform like you would in .Net by using the XsltArgumentList class? Thanks.
View 3 Replies
View Related
Sep 11, 2006
Where does output from <xsl:message> stylesheet elements go? It's not in the Progress or Output window, and there doesn't seem to be a property that controls the destination for messages.
View 4 Replies
View Related
Sep 4, 2007
I'm reading over this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1884062&SiteID=1
and I'm kinda lost as to what to do to strip out the dtd from an XML file I am downloading. I do NOT know XSLT and for that reason, I can't follow his logic.
My SSIS package downloads my XML file just fine, now I need to do a strip of the DTD line in my XML Task.
The person who provided the solution in the above post said to do this...
Code Snippet
Operation Type: XSLT
Source Type: Variable
Source: Variable's name containing the xml text
Save Operation Result: True
DestinationType: Variable
OverwriteDestination: True
Destination: Variable's name which is to contain the original xml minus the DTD.
SecondOperandType: Variable
That stuff I understood. I'll replace variables with my files because they are stored that way, but from what I can tell, that's not my problem.
The stuff he says below this comment is going over my head like a ton of bricks. I can't figure out how to do it.
This is the kind of line of my XML that I want to strip out.
https://www.myaddy.com/pbdr.dtd"[]>
and then he said this...
Code Snippet
Since XSL doesn't know about DTDs, telling it to copy everything strips out DTDs. Then use the Variable specified in the Xml task's SecondOperand as the Source data for the xml source.
Code Snippet
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:copy-of select="." />
</< FONT>xsl:template>
</< FONT>xsl:stylesheet>
A note on how to paste a multi-line xml document into a Integration Services String variable:
Integration Services String variables textboxes are not multi-line, in the Windows sense of a line (CR+LF),
So, in order to paste multi-line text (which xml docs almost always are), save a temporary copy with a unix line ending.
That is, create an xml file in visual studio, and paste your sample original xml in there. Go to File/Advanced Save options, and save the xml with the the settings of Encoding: Unicode (utf-8 without signature) - CodePage 65001, and most importantly, set the Line endings dropdown to "Unix (LF)".
After selecting "OK", copy and paste the text from Visual Studio's xml file editor into the IS variable, and you'll note all the xml data appears.
So can anyone walk me through a dummies version of what he is suggesting to do?
Thanks,
Keith
View 1 Replies
View Related
Nov 1, 2007
Hi guys,
I have a simple report created with rs2005. I want to get the output exported (using the export options of rs2005) in a specific xml format, so I am using xslt transformation to get it proper.
My problem is that, when I'm doing this using my own machine (SQL Server 2005 32bit installed) everything works OK. BUT when I want to try it on a server that we are supposed to use it gives me a real bad error. On the server, if I have the report without using xslt, it gets exported OK but not in the correct format. I have tested the report on a 32 and on a 64 bit server, I have used either SP1 and SP2 but still can't get through. The error message appearring while I try to export in xml is "Server Error in '/Reports' Application. The XSLT path is invalid. It refers to an external resource, uses invalid syntax, or the XSLT was not found in the catalog."
Has anyone seen something like this before ?
Your help would be much appreciated.
Thanx in advance
View 5 Replies
View Related
Jun 27, 2007
Hi Does anyone have any information on how I can due a XSLT Transformation on XML Data Stored in SQL Server 2005?Thanks for the helpBones
View 10 Replies
View Related
Sep 14, 2006
Hi All,
I'm using some xslt documents to transform the xml output of my Reports
but have come across two curiosities where the xslt filter seems to
behave unusually.
Firstly, I need the final saved file to have an xml declaration, which
I believe it should do by default. Even if I put
omit-xml-declaration="no" in the xsl:output tag I don't get an xml
declaration. At present we have a custom job that writes these
declarations back into the xml after SRS has saved it.
Secondly and more importantly, I need to have some of my output tags
wrapped in CDATA sections. I've tried using the cdata-section-elements
attribute, again with no luck.
my XSLT looks something like this (simplified for space)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" media-type="text/xml" omit-xml-declaration="no" cdata-section-elements="description"/>
<xsl:template match="/">
<xsl:for-each select="Report/table1/Detail_Collection/Detail">
<item>
<description>
<xsl:value-of select="@Description"/>
</description>
</item>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The output is something like:
<item>
<description>My first description text...</description>
</item>
<item>
<description>My seconddescription text...</description>
</item>
What I want is:
<?xml version="1.0" encoding="utf-8"?>
<item>
<description><![CDATA[My first description text...]]></description>
</item>
<item>
<description><![CDATA[My secondfirst description text...]]></description>
</item>
All help gratefully appreciated.
Thanks - Andrew.
View 5 Replies
View Related
Mar 3, 2008
Hello everybody,I was configuring a SqlDataSource control using SQL Authentication mode.I first added a database file (testdb.mdf) through Solution Explorer-Add New Items. Then through Database Explorer I created a table named "info"Then while configuring the SqlDataSource control I used the SQL Authentication mode and attached the "testdb.mdf" database file.Test Connection showed success. But when I hit the Ok button of the wizard it displayed the following error message:Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance.While configuring the SqlDataSource control I clicked "New Connection". Under Data Source section I tried both Microsoft SQL Server and Microsoft SQL Server Database File. And in both the cases I attached a databese file(testdb.mdf). Plz enlighten me on this.Thanks and Regards,Sankar.
View 1 Replies
View Related
Jan 30, 2014
I need to convert an xml file that has an attribute(name). This xml file has to be converted using xsl into the XSLT file such that the tag should have the same structure along with it and its the tag-content also should be the value of the attribute.
<?xml version="1.0" encoding="utf-8"?>
<PatientUpdateRequest xmlns="http://medseek.com/ecoEnablement/Schemas">
<General>
<SendingApplication>SendingApplication1</SendingApplication>
<SendingFacility>SendingFacility1</SendingFacility>
[code].....
View 1 Replies
View Related
Jan 9, 2007
Hi!
When MS published starter kits there were files .sql in App_Data. This files contained some sample data for a DB. How to create such files when I have database with data ?
Jarod
View 2 Replies
View Related
Oct 20, 2007
how generate an xml file from data in sqlserver2005
and read it in sql again
View 4 Replies
View Related
Nov 20, 2002
One of my first tasks on my current project was to generate all of the SQL scripts needed to rebuild the database. Of course, one of the catches was that everything needed to be separated out (table columns in different script from PKs different from FKs different from DEFAULTs, etc., etc.). And we wanted our own comment block inserted. So, I couldn't just use the Generate SQL Script from Enterprise Manager and be done with it. I was going to need to do some more work. Well, here's one of the scripts I wrote to build the FK scripts. Execute this script, then copy & paste the results into a new window. Break apart into separate .sql files as desired.
NOTE: Be sure to show results in Text (not grid) and change the display options in QA to return more than just 256 characters.
/***************************************************************************************************
Author: Mark Caldwell
Date: 11/15/2002
Descrip: Generate scipt commands to ADD FOREIGN KEY CONSTRAINTS for constraints already in DB.
NOTE: Be sure to set your Tools/Options/Results/Maximum Characters per column to a
large enough number (such as 2000) to display the entire command.
***************************************************************************************************/
SELECT
'----------------------------------------------------------------------------------------------------
-- ' + so2.name + ' to ' + so3.name + '
----------------------------------------------------------------------------------------------------
IF OBJECTPROPERTY(OBJECT_ID(N''' + so1.name + '''), ''IsForeignKey'') = 1 BEGIN
ALTER TABLE ' + so2.name + ' DROP CONSTRAINT ' + so1.name + '
PRINT '' -- DRP - ' + so1.name + '''
END
G' + 'O
ALTER TABLE ' + so2.name + '
ADD CONSTRAINT ' + so1.name + '
FOREIGN KEY (' + ISC1.COLUMN_NAME + ')
REFERENCES ' + so3.name + '(' + ISC2.COLUMN_NAME + ')
PRINT '' -- ADD - ' + so1.name + '''
G' + 'O
'
FROM sysforeignkeys sfk
JOIN sysobjects so1 on sfk.constid = so1.id
JOIN sysobjects so2 on sfk.fkeyid = so2.id
JOIN sysobjects so3 on sfk.rkeyid = so3.id
JOIN INFORMATION_SCHEMA.COLUMNS ISC1 on so2.name = ISC1.TABLE_NAME AND sfk.fkey = ISC1.ORDINAL_POSITION
JOIN INFORMATION_SCHEMA.COLUMNS ISC2 on so3.name = ISC2.TABLE_NAME AND sfk.rkey = ISC2.ORDINAL_POSITION
ORDER BY so2.name
Edited by - AjarnMark on 11/20/2002 02:46:11
View 1 Replies
View Related
Oct 22, 2006
The web site I am building is working fine locally, but I am hitting some problems with setting it up on a remote hosting server.First off, how can I generate the sql script to populate the SQL db on the remote server?I am using VS 2005 Standard. Do I need to d/l the SQL Server Express?Once I get that going, I should be able to figure out the rest...but I'll prolly have another question or two.Thanks
View 2 Replies
View Related
Feb 15, 2008
Hello everyone.
i need to auto generate the user id in id colunm in my sqldatabase table.i want it to generate in this fashion.(mycompanyname-todaydate-number.)eg (ibm-15thfeb-1) (ibm-15thfeb-2) (ibm-16thfeb-1)here i need this user id to be automatically displayed in my web form when doing registration of new user,then only after clicking the savebutton i want all the data along with user id to be inserted into the table in sqldatabase.thanksjack.
View 38 Replies
View Related
Jul 16, 2005
Hi, I have a question, I have created a table and with a primary key called "ID". However, I want the "ID" be auto increment as well. when inserting new record into the database.I'm using vb.net. how can I do in the following format: "1", "2", "3", ............ etc. I've the code below but it's not working in the right way, what's wrong with my code?
Private Sub BtnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim ssql As String
Dim Itemid As Integer
Dim updcmd As SqlClient.SqlCommand
Itemid = 0
mysqladap = New SqlClient.SqlDataAdapter("select MAX(Item_id) From auction where item_type= '" & (Image1.ImageUrl) & "'", mySqlConn)
Itemid = (Itemid) + 1
ssql = "insert into auction (item_id,owner_name,owner_mail,owner_mobile,owner_phone,owner_ext,item_type,item_name,item_image,item_desc,item_cost,start_date) values ('" & (Itemid) & "','" & Trim(ownertxt.Text) & "' ,'" & Trim(emailtxt.Text) & "', '" & Trim(mobiletxt.Text) & "', '" & Trim(phonetxt.Text) & "','" & Trim(exttxt.Text) & "','" & Trim(DropDownList1.SelectedValue) & "','" & Trim(itemtxt.Text) & "','" & Trim(Image1.ImageUrl) & "','" & Trim(desctxt.Text) & "','" & Trim(costtxt.Text) & "','" & Trim(Today.Date) & "')"
updcmd = New SqlClient.SqlCommand(ssql, mySqlConn)
updcmd.ExecuteNonQuery()
lblmsg.Visible = True
End SubAnyone can help me? Thanks.
View 7 Replies
View Related
Apr 2, 2001
Are there any scripts available with anyone, for generating SQL scripts for all the objects in a server?
Thanks
View 1 Replies
View Related
Apr 2, 2001
I want to transfer some procedures using a generated script. However, the procedures that create pre-existing tables will not be created. Is there a way to shut off the validation so that I can create these procedures without getting errors?
Thanks for the help
View 1 Replies
View Related
Jun 7, 2002
Is there a way to write a dts package that will Generate SQL Scripts for a particular database? I am just learning dts and would like to automate this process that I run on weekly basis.
Thanks,
Steve
View 1 Replies
View Related
Nov 13, 2006
can I generate excel from stored procedure?
View 2 Replies
View Related
May 2, 2006
hi all,
how to generate txt file from sql table. I want text file with respective columns without any seperator between columns. and if for an example a column of int having 5 digits but i want it in text file with 10 digits with remaining all as blanks. guide me how to do this.
thnks in adv
View 6 Replies
View Related
Apr 28, 2008
This is my first time on sqlteam forum so a big hello to everyone!!
Firstly I am very noive user of sql to say the least, but i have be requested to create a .txt file
Its for a program that will read the txt file i create to produce a letter i.e I will be extracting, TITLE, FORENAME, SURNAME etc
MR
JOE
BLOGGS
Here is the my code so far, like i said i am a very novice user so try to help me and not condem me for my lack of knowledge!
SELECT
LPA_INPUT.INPUT_TITLE,
LPA_INPUT.INPUT_SURNAME,
LPA_HISTORY.LPA_AMT,
LPA_HISTORY.ELIG_RATE,
LPA_HISTORY.RATE_REBATE,
LPA_HISTORY.RR_AMT,
LPA_HISTORY.LPA_APPLIC,
LPA_HISTORY.LPA_AMT
FROM LPA_HISTORY, LPA_INPUT
WHERE LPA_HISTORY.CLAIM_NO = LPA_INPUT.CLAIM_NO
----------------------------------------------------
Iv been asked to have these eight fields looping over and over for all the records in the database, So im not to how to do that and how to generate it in a txt file?!
Keith
View 5 Replies
View Related
Jul 29, 2005
--This procedure will generate the Structure of a table
Create Procedure GenerateScript (
@tableName varchar(100))
as
If exists (Select * from Information_Schema.COLUMNS where Table_Name=@tableName)
Begin
declare @sql varchar(8000)
declare @table varchar(100)
declare @cols table (datatype varchar(50))
insert into @cols values('bit')
insert into @cols values('binary')
insert into @cols values('bigint')
insert into @cols values('int')
insert into @cols values('float')
insert into @cols values('datetime')
insert into @cols values('text')
insert into @cols values('image')
insert into @cols values('uniqueidentifier')
insert into @cols values('smalldatetime')
insert into @cols values('tinyint')
insert into @cols values('smallint')
insert into @cols values('sql_variant')
set @sql=''
Select @sql=@sql
+case when charindex('(',@sql,1)<=0 then '(' else '' end +Column_Name + ' ' +Data_Type +
case when Data_Type in (Select datatype from @cols) then '' else '(' end
+case when data_type in ('real','money','decimal','numeric') then cast(isnull(numeric_precision,'') as varchar)+
','+case when data_type in ('real','money','decimal','numeric') then cast(isnull(Numeric_Scale,'') as varchar)
end when data_type in ('char','nvarchar','varchar','nchar') then cast(isnull(Character_Maximum_Length,'') as varchar) else '' end
+case when Data_Type in (Select datatype from @cols)then '' else ')' end
+case when Is_Nullable='No' then ' Null,' else ' Not null,' end
from Information_Schema.COLUMNS where Table_Name=@tableName
select @table= 'Create table ' + table_Name from Information_Schema.COLUMNS where table_Name=@tableName
select @sql=@table + substring(@sql,1,len(@sql)-1) +' )'
select @sql as DDL
End
Else
Select 'The table '+@tableName + ' does not exist'
Madhivanan
Failing to plan is Planning to fail
View 14 Replies
View Related
Apr 22, 2007
i recently moved from sql server 7 to sql 2005 -- in sql 7 if i wanted to generate an sql script then It would generate a whole script ---
in sql 2005 - when i do generate it seems to attach a file --
I want to generate a script that I can then modify and use to create a new db -- is this possible?
View 6 Replies
View Related
Jun 4, 2007
Hi All!
I was thinking of creating a custom generated IDs for my table. I would like the ID to be something like "HR001" or "IT001", the two letter prefix would indicate the dept it belongs to. Initially I thought of having a table that will hold all the seed values for the IDs but I realize that this could have some concurrency problems if there will be a multiple number of users are creating a record at the same time. So now I have totally no idea on how to deal with the concurrency problem.
I will not be using this as a primary key because I already have the Identity field to be my primary key, though of course this field would definitely be unique. I will just be using this to display in the UI.
Any inputs would be greatly appreciated.
Thanks!
View 16 Replies
View Related
Jul 13, 2007
Hi,
Do someone know if there is a SP_ or XP_ function for help me create a script of create table? I can do it "on-line" by right click a table in Enterprise-Manager (all properties;generate sql-script), but I want to "call a command" to do this.
Very glad if someone know!
//Lotta
View 6 Replies
View Related
Nov 24, 2007
is there any easy way I can take a select statment
(such as select from payments where datetime>'20071122' and output a sql insert statment for these records?
I basically need to move a specific set of records from one sql server to another (both sql server 2005)
any suggestions for the best way to do this?
View 4 Replies
View Related
Feb 26, 2008
I need a sql query that generate sql script(.sql) of all the databases at once.
View 1 Replies
View Related