Showing posts with label header. Show all posts
Showing posts with label header. Show all posts

Monday, March 26, 2012

How to append a header row in SELECT

Hi All,

When calling my SELECT statement, I would like to have Column name and Data type as the first record. Is this possible to do?
I would like to make a SP that would select all data from any table(with a header row) with just:

_sp_getData ' table_name'

I looked at sysobjects, and syscolumns tables, but was unable to put it all together. I have over 200+ tables, so creating variables for every column is very cumbersome.

Something like this:


select 0 AS SortCol ,
cast(min(case ordinal_position when 1 then column_name end) as varchar) as col1,
cast(min(case ordinal_position when 2 then column_name end) as varchar) as col2,
cast(min(case ordinal_position when 3 then column_name end) as varchar) as col3,
cast(min(case ordinal_position when 4 then column_name end) as varchar) as col4,
cast(min(case ordinal_position when 5 then column_name end) as varchar) as col5,
cast(min(case ordinal_position when 6 then column_name end) as varchar) as col6,
cast(min(case ordinal_position when 7 then column_name end) as varchar) as col7,
cast(min(case ordinal_position when 8 then column_name end) as varchar) as col8,
cast(min(case ordinal_position when 9 then column_name end) as varchar) as col9
from information_schema.columns where table_name = 'authors'
union all
select 1 , au_id, au_lname, au_fname, phone, address, city, state, zip,
cast(contract as varchar)
from authors


Is not an option.

Thank you very much in advance,
Vla OrlovskyJust an advice: do not do it. THis is not SQL. You add an additional non-data row int data. VERY bad style.

Especially as you then go on and say the one way to do it (union) is not an option.|||Hi Tom,

Thanks for reply.

In my case, I just want to export data into a VB RecordSet and into a CSV text file.
My co-workers want to have the data to be imported into other places.
I just want to create a simple GUI that allows them to get the data without involving me.

Sincerely,
Vlad Orlovsky|||So what?

Before exposrint to a CSV file, write the first line with the names of the columns.

Interesting enough, the information is in the VB recordset.|||If I understand correctly, before you output the actual data to CSV, you can just loop through the fields collection on the first row of your recordset and output the Name and Type property like below:

For intCounter = 0 To oRS.Fields.Count - 1
strName = oRS.Fields(intCounter).Name
strType = oRS.Fields(intCounter).Type
Next|||Hi,

I wanted to get the data the most fastest way posible.(with very little IIS processing)

Sincerely,
Vlad Orlovsky

Friday, March 9, 2012

how to add column header in a Matrix

Hi,

is there a way to add column header in a Matrix?

Thanks,

Igor

Igor,

Right Click in your Matrix data row, you can select "add column".

Ham

|||

what I meant was I want find out the way to add a column header to a group in the matrix.
Is it possible?

Thanks,
Igor

|||

Igor,

You can still use the same as a "Header", I create my column, drag the textbox to where I want it display and in my expression I just type the heading that I want.

I hope this helps.

Carl

|||it's a good solution, the only problem is that it doesn't look good when rendered to html. In excel it displayed at the bottom.|||

Igor,

Thanks for the update. I'll take another shot at it and see if I can spuce it up a little.

Ham

Wednesday, March 7, 2012

How to add a image to the ReportVeiwer

Good day all

I have the vwd 2005 express and am playing around with the report veiwer.

How can i put the image on my report ( as a header) . I have draged the image control from the toolbox onto my Report.rdlc form , but it,s not the same as the image control in the toolbox for the "aspx" forms. I cannot right click and set a image URL.

There is a backgroundImage property but the wording is unfamilier to me eg, Source.. External , Value... MIMEType etc.

Can anyone help with getting the image into the report?

Thanks

Rob

Hi Rob,

The only way to add image in the report is by using the image control, and yes its different from the one for the aspx pages.

When you place a image control on the form an image wizard will be opened where you can choose whether you want the image to be embadded into the report itself/use a common image for a project/image stored in database/use an image hosted on net.

Just select the appropriate option and select the image. For more information check these links -

http://msdn2.microsoft.com/en-us/library/ms156388.aspx

http://msdn2.microsoft.com/en-us/library/ms156482.aspx

how to add a image from database to page header

Hi,

I am having same issue, but the data is an image stored in database. actually its an company logo which i need to display on every page.

i have a doubt. if i user source as external and an URL in a image property, then my image will not appear if the Reporting Server and Application Server are on two different machines. if both are in one machine as my local machine(development machine) the image appears.

is this an known issue or how to solve this. due to this reason, we thought of putting images in database and pulling out, but it turned out to be an another problem.

You can follow the approach described in Books Online (scroll to "Adding a Databound Image to a Header or Footer"): http://msdn2.microsoft.com/en-us/library/ms159677.aspx

Note: if you are doing this on Reporting Services 2005, you should definitely first install SP1 (http://www.microsoft.com/sql/sp1.mspx) for both, the report server and the machines with BI Development Studio / Report Designer.

-- Robert

Friday, February 24, 2012

How to add a group header and footer for a report

I have a report that is being called via stored proc, and i want to group by contract. when report gets generated i get multiple contracts info. but will be grouped/sorted by contract.

please how can i have a group header and also a group footer to show a summary of each contract information with some calculated fields in it.

i may get 100 records related to 10 contracts , 10 rows for each contract.

as soon as the first contract info is shown on the report it has to show a summary related to the first contract in the group footer, and then continue populating the second contract info and so on.

Please i am totally new to reporting and help would be appreciated. thank you all.

Here's what you can do:

Click anywhere on your table while in Layout.
Right click on the box next to your details row (it has 3 horizontal bold bars on it), and select 'Insert Group'.
On the 'General' tab, make sure 'Include group header' and 'Include group footer' are both checked.
In the 'Group on:' section, drop down the box and select your contract field. (Or you can type: =Fields!contract.Value)
On the 'Sorting' tab, again, pick or type your contract field as above.
On the 'Visibility' tab, make sure that the 'Visible' radio button is selected.
Hit 'OK' and now you can add your fields to the group header and footer.

Hope this helps.

Jarret

|||

Did this work for you Reddymade?

Jarret