Monday, March 26, 2012
PDF Export For Matrix And Chart
2 rows in a table object, Row 1 has Matrix, Row 2 has Chart.
When I export to PDF, the Page always breaks before I get the chart.
If I put the chart in Row 1 and the Matrix in Row 2, no problem with
page break.
Any ideas?
I've posted quite a few times re: the PDF exporting of Reporting
Services, I see this as the major weakness of the product. Does MS
have any plans to correct the PDF engine so it robust enought?
Thanks.
Tim Heuer
heuert@.comcast.netI have run into similar sounding problems and have had little response. It
appears there are a number of known issues with PDF and Excel for that
matter, but I havent heard if and when they are going to address them.
"teem60004" wrote:
> I have a very simple report with a matrix and a subreport chart.
> 2 rows in a table object, Row 1 has Matrix, Row 2 has Chart.
> When I export to PDF, the Page always breaks before I get the chart.
> If I put the chart in Row 1 and the Matrix in Row 2, no problem with
> page break.
> Any ideas?
> I've posted quite a few times re: the PDF exporting of Reporting
> Services, I see this as the major weakness of the product. Does MS
> have any plans to correct the PDF engine so it robust enought?
> Thanks.
> Tim Heuer
> heuert@.comcast.net
>
Saturday, February 25, 2012
Pass-through to SAS
I was recently tasked with Data Profiling and sitting next to me is a SAS developer, who just has to run a couple of functions, to do what has taken me days (and I haven't finished!). If I could call out to SAS and run the SAS functions it would be great. I have looked on the net and can see SAS calling out to SQL but not the other way round. Technically I'm probably not up to this but I don't want this to hold me back... so any help would be great.It probably is possible, and the method depends on exactly what you want to do. I'm sorry I can't be more specific, but without more to go on that is the best I can do.
If you have the ODBC driver for SAS, that would help a lot. If not, but you can execute master.dbo.xp_cmdshell and put the SAS client on the server, that might help too.
-PatP|||Uhmmm, what are you trying to do? Maybe there is a faster method that you are not aware of...|||Sorry for the delay I've been away....
I'm going to leave the communication to SAS from SQL for now, but I had a look at another thread 'Cursor or temp table' which seemed appropriate, I'm well aware coming from Foxpro to SQL I have a lot to learn.
I was tasked with data profiling on our warehouse and so set to writing some generic functions to gather some basic statistics on the dml layer. (Looked at what SAS could provide and it was just over the top)
1. How many nulls
2. Frequency on values
3. Min & Max values
I gathered the database info from information_schema, added an extra column to tag the tables and columns I was interested in and then used this to run the MAX(), MIN() and COUNT(*) functions and then stored the results to a table.
My questions are: I'm I missing something, could I have done this without a cursor? 2) Would it have been faster and better to create a temp table and then skipped thru that? 3) I couldn't have done all this in a select could I?|||Yeah, you could probably do it all in a SELECT, unless there are some odd complications you not telling us about.
Monday, February 20, 2012
Passing SqlDataSource object an array as a parameter
Hi,
I am trying to get the selected options from a listbox and either pass a SqlDataSource object the array or loop through it and pass each element of the array. I then need to modify the returned databtable to graphing function, but first drop the last column. I was wondering if anyone can help me with the following:
1. Pass an array into SqlDataSource Select OR
2. Pass a single argument into the Select statement and populate a datatable without it writing over the current row each time it iterates through the foreach statement. I am looking for the dataview to append to dt each time it loops. Is there a property for dataview that behaves like the "ClearBeforeFill" for table adapters?
3. Update a parameter programmatically
Below code works, but I think it can be more efficient. Any suggestions would be greatly appreciated.
Thanks in advance!!
DataTable dt = new DataTable();
DataTable dt2 = new DataTable();
DataView dv = new DataView();
foreach(ListItem liOptions in ListBox1.Items)
{
if(liOptions.Selected)
{
SqlDataSource1.SelectParameters.Add("Parameter1", liOptions);
dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
dt2 = dv.Table;
dt.Merge(dt2);
dt2.Dispose();
SqlDataSource1.SelectParameters.Clear();
}
}
if (dt.Rows.Count > 0)
{
Graph(dt); //Pass original datatable (dt) to Graph();
dt.Columns.RemoveAt(2); //Reformat datatable (dt) and remove last column before binding to Gridview1
GridView1.DataSource = dt;
GridView1.DataBind();
} else {
errorMessage.Text = "No data was returned!";
}
Dear sillyrabbit,
XML. It's a new feature in SQL Server 2005. If you don't have SS2005, then I don't think this will work for you.
The best way to pass an array to is to use XML.
XmlDocument xmlDocument =new XmlDocument();XmlElement rootNode = xmlDocument.CreateElement("RootName");xmlDocument.AppendChild(rootNode);XmlElement xNode;XmlText xText;for (int intList = 0; intArray.Length > intList; ++intList){if (intArray[intList] != 0){xNode = xmlDoc.CreateElement("IdName");xText = xmlDoc.CreateTextNode(intArray[intList].ToString());rootNode.AppendChild(xNode);xNode.AppendChild(xText);}}return xmlDocument.InnerXml;http://grahamsibley.typepad.com/thoughtfactory/2006/09/stored_procedur.html
hope this helps,
fathrDave
|||Also,
Your SqlDbType needs to be XML.
In the Stored Procedure I used "CROSS APPLY @.xmlName.nodes('//IdName') as R(nref)" to join to my DB tables (after the FROM). I did a "dbField = nref.value('.', 'int')" to connect it to DB table (after the WHERE).
I did have some trouble with ArithAbort and had to Set it to ON before I ran the proc, and then OFF afterwards. Also, the time (timeout) is a factor and I am trying to solve that currently.
hope this helps too.
fathrDave
|||Thanks very much for the suggestion. I'll give it a try.