Posts

Showing posts from June, 2009

Sql Server Reporting Services export to PDF in Landscape

So I have found a need to create ssrs reports in pdf format. Some of these reports contain a lot of data. So I needed to layout the page in landscape format. Sadly there is no page layout settings in srrs (once again Crystal wins but that is another story). So to achieve the same thing you will need to change the settings of the page. Open the properties of the report and set the width=29cm and height=21cm. These are the settings for landscape. Now you have a lot of extra room to move things around. I also found to maximize the report you can get the width of the report to about 22.86cm.

So to summarize
width=29cm (11.41")
height=21cm (8.27")
report data=27.30cm (10.75")

C# Finding all tables in access file

I recently found a need to access table names found in an access file dynamically. I found some code on the net to do this. But I discovered a bug, the code I was using would only read static tables. The files I was getting could contain linked and pass-through tables. So after some more searching I found the best way was to get all the tables (system, access) etc and then filter out only what I needed. So after some coding here is the solution. This is sitting in a function


public static DataTable GetTableNames( string accessFile )
{

OleDbConnection con = null;

try
{
// create a connection string
String connect = String.Format( "Provider=Microsoft.JET.OLEDB.4.0;data source={0}", accessFile );

// open the connection
con = new OleDbConnection( connect );
con.Open();

// get all the tables in the file, system, etc
DataTable dtAllTables = con.GetOleDbSchemaTable( OleDbSchemaGuid.Tables,
new object[] { null, null, null, null } );

DataTable filterTable = dtAllTab…