Showing posts with label print. Show all posts
Showing posts with label print. Show all posts

Wednesday, March 21, 2012

detect existence of datetime fields

I'm looking for an efficient t-sql script to loop through all user
tables in a db and determine/print the value of each row having a
datetime field (including cases where there are multiple datetime
fields per row)

Help greatly appreciated.."JTWhaler" <jonahturnedwhaler@.yahoo.com> wrote in message
news:ed564348.0401022017.34730d8@.posting.google.co m...
> I'm looking for an efficient t-sql script to loop through all user
> tables in a db and determine/print the value of each row having a
> datetime field (including cases where there are multiple datetime
> fields per row)
> Help greatly appreciated..

Here is a script that does a reasonable task of generating
a useful data dictionary out of any database.

To identify the datetime fields simply add
a restriction line in the WHERE bit ... such as
and t.name in ('DateTime', 'SmallDateTime')

select substring(o.name,1,50) as "Table Name",
o.type "Typ",
c.colid,
substring(c.name,1,30) as "Column Name",
substring(t.name,1,30) as "DataType",
c.length

from sysobjects o
left join syscolumns c on (o.id=c.id)
left join systypes t on (c.xusertype=t.xusertype)
where o.type = 'U'
order by 1,3|||jonahturnedwhaler@.yahoo.com (JTWhaler) wrote in message news:<ed564348.0401022017.34730d8@.posting.google.com>...
> I'm looking for an efficient t-sql script to loop through all user
> tables in a db and determine/print the value of each row having a
> datetime field (including cases where there are multiple datetime
> fields per row)
> Help greatly appreciated..

Hi Jonah

The attached T-sql will create a database table that contains an entry
for each datetime column in the database

drop table datetime_column

create table datetime_column
(
table_name varchar(200)
,column_name varchar(200)
,datetime_value datetime null
)
declare @.table_schema as varchar(200)
declare @.table_name as varchar(200)
declare @.column_name as varchar(200)
declare @.query as nvarchar(1000)

DECLARE column_cursor CURSOR FOR
SELECT
table_name, column_name
FROM
INFORMATION_Schema.columns
where
data_type = 'datetime'
and table_name != 'datetime_column'

open column_cursor

FETCH NEXT FROM
column_cursor
INTO
@.table_name, @.column_name

while @.@.fetch_status = 0
begin
select @.query = ' insert into datetime_column select ' + '''' +
@.table_name + '''' + ',' + '''' + @.column_name + '''' + ',' +
@.column_name + ' from ' + @.table_name
--select @.query
exec sp_executesql @.query

FETCH NEXT FROM
column_cursor
INTO
@.table_name, @.column_name
end

close column_cursor
deallocate column_cursor
select * from datetime_column

Monday, March 19, 2012

Detail Section Limit Records

Hi,

I have limited my detail section output to print 20 records per page, but if have total of 108 records ,First 100 records are printing 5 pages and the 6 thpage prints 8 records .

I want that the 6 th page to print 8 records , plus 12 lines filled with dashes (---).Making the page to appear having 20 lines .

Can anybody help

thanks
ShaliniI had resolved something like that by modifying the data source, I mean, generating the extra lines when writing the output file

Detail in Table shifts report

Hi,
I work for a paryroll company and we are using rs to print checks from. The
fields on the report need to be fixed so the micr does not move. When the
detail gets filled in on the tables though it shifts everything down and up
(Like the micr at the bottom of a check) depending on how many detail lines
are in the table.
Is there any way to make this stop from happening?One thing you might do is to
1. Determine the max number of details that can be printed in the space
prior to the micr-code.
2. then ensure in your sql select that you only select fewer than the max
detail rows per master..
You might also try some sort of trick with the filter or hidden properties
ie
rowcount(detailgroup) >5 Either to filter out the rows, or hide the
details..
Hope this helps.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"sangred" <sangred@.discussions.microsoft.com> wrote in message
news:AB1A28F3-518D-4A8A-B7E6-AEF040F06F30@.microsoft.com...
> Hi,
> I work for a paryroll company and we are using rs to print checks from.
> The
> fields on the report need to be fixed so the micr does not move. When the
> detail gets filled in on the tables though it shifts everything down and
> up
> (Like the micr at the bottom of a check) depending on how many detail
> lines
> are in the table.
> Is there any way to make this stop from happening?|||Another solution is to enclose the dynamically sizing tables within a
rectangle. The rectangle will act as a "frame" and the table will only size
within the rectangle (and not shift anything outside of the rectangle).
"sangred" wrote:
> Hi,
> I work for a paryroll company and we are using rs to print checks from. The
> fields on the report need to be fixed so the micr does not move. When the
> detail gets filled in on the tables though it shifts everything down and up
> (Like the micr at the bottom of a check) depending on how many detail lines
> are in the table.
> Is there any way to make this stop from happening?

Friday, February 17, 2012

Design Preview Vs Print Preview

My report that I am writing looks great and pages properly (have the option selected to keep a table together ) when it is in the Reporting Services development preview. But as soon as I click on the print preview, which includes exporting it to a PDF, I get bold lines, other weirdities and the table in the report will split across pages etc.

Ideally, I would like it to print exactly as it looks in the RS preview.

Any ideas?

dotnetnow

While in design-view, right-click and select Properties then Layout tab. This is where you can set margins and page size/orientation, anything you do here will affect the output to PDF.