Showing posts with label suppose. Show all posts
Showing posts with label suppose. Show all posts

Monday, March 26, 2012

how to fix report layout problems

When you use Report designer in the BI development studio, on the Preview tab, you can have a straight preview or a print layout preview. I suppose what you see in the print layout preview is what you get when you print the report or export the report to the other format.

However, often you see everything looks perfect in a straight preview but does look right in the print layout preview. For example, you might get the following problems in the print layout preview, even if everything looks perfect in a straight preview.

· Every even page is a blank page

· Items that should be together on the same page are separated into different pages. For example, on the first page, I had a TextBox1 followed by Image1 then followed by TextBox2. Both textboxes have constant (static) values, and Image1 holds a jpg image. Strangely enough, when I do print layout preview, I saw both textboxes and blank space in-between on the first page, and then saw the image on the second page. No matter how I adjust and what I adjust (position, size, bring to front, send to back, ... etc), I just could not get them into the same page, and I have no clue why.

Can anyone provide some suggestions, advices, experience, knowledge, or pointers?

Where and what elements should I look into to fix the layout problems stated above?

Thanks in advance.

Chris in Toronto

Hi There,

It's probably a problem with page width. Your report is too wide to fit on a single page, and so the right hand edge will be carved off into a new page, hene every other page is blank or your data is split across pages.

The report should be something like 21cm by 29.7cm (sorry, I can't remember the inch equivalents). And the body should be about 18cm wide. (at least these measurements certainly fit on a sheet of A4 in one of my reports).

Cheers - Andrew.
|||

I have already considered the page width.

No matter how I adjust the page width, it does not fix the two problems that I described.

Thanks anyway.

|||

When you looked at the page width vs. body width, did you consider the size of the margins? This blog article might help:

http://blogs.msdn.com/chrisbal/archive/2006/08/10/694892.aspx

This situation is the only one I'm aware of that will reliably cause every other page to be blank in physical page layout renderers.

-Chris

Wednesday, March 21, 2012

How to find the end month date of the particular date.

Suppose i am taking abc as input as a parameter from the user to generate report.
user input 10/20/2006 i want's to find out the end month date of this date that is 10/30/2006
or if he input 1/15/2005 |I want to find 1/31/2006.
I want to do from the report function not query.
how can i do that

> I want to do from the report function not query.

I'm not quite sure what you mean by this. I supose this means that you don't want to do it in MDX, but you don't mention what you are using as a reporting front end. In psuedo code what you would do is

1) subtract the day number from the date ( this should give you the last day of the previous month)

2) add 1 month to the date you got from the first step.

|||

Can you please give a working example ?

Do you know about any thing about date subtract in SSRS
Like I have 2/15/2007 as input parameter from report I want's to subtract 15 days and result should be like 1/31/2007

I have get the day from the date and i can add a month also in the date But I cant' find any thing about how to subtract days from the date and result should be another date

|||

You should be able to add the following in the code section of your report and then just call this function.

function GetLastDayInMonth(dt as DateTime) as DateTime

return dt.AddDays(-dt.Day).AddMonths(1)

end function

sql

Friday, February 24, 2012

how to find Data Type of a Declared Variable

how to find Data Type of a Declared Variable in sql server?
i googled a lot but could not find ans.
suppose
Declare @.Var1 int
now i want to find datatype of @.var1.
plz help.Hi Amit
Can you explain why you need to do this?
Variables are extremely local in SQL Server; they have no existence outside
the batch where they are declared. So you can never see or use, much less
find out the datatype, from any variable in any other batch. For variables
in the current batch, whoever wrote the batch has to define them so why
wouldn't that information be available?
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com
"amit sharma" <amit sharma@.discussions.microsoft.com> wrote in message
news:A07C1CC0-B0C2-4D98-80C7-DEDB221FC783@.microsoft.com...
> how to find Data Type of a Declared Variable in sql server?
> i googled a lot but could not find ans.
> suppose
> Declare @.Var1 int
> now i want to find datatype of @.var1.
> plz help.
>|||Typing and variables are relatively insignificant in sql. They are so
alien that MS has tried to create a bypass for programmers who think
in such terms. I suggest you look at LINQ to Sql for a way to make
sql understandable and workable in a natural programming enivornment.
www.beyondsql.blogspot.com

Sunday, February 19, 2012

How To Find a Mismatch between tables

What is the best way to write a query to find a mismatch between 2 tables?
For instance, suppose you had 2 tables, each in a different database, but yo
u wanted to make sure the addresses in each table were in sync.
Table 1 = Ship To Number (PK), Name, Address1, Address2, Address3, City, Sta
te, Zip
Table 2 = Ship To Number (PK), Name, Address1, Address2, Address3, City, Sta
te, Zip
What is the syntax to find where a difference occurs between the 2 tables ?
I know how to write the query to join them and find difference if Address1 i
s different, where I am struggling is with Address1 or Address2 or Address3
or City or State or Zip is different.
I am thinking this has to be a subquery of some sort, but am totally drawing
a blank.
Any suggestions will be greatly appreciated.
jlsIs that going to be a fun query :) How about...
SELECT MIN(tname) as TNAME, ShipToNumber, Name, Address1, Address2, Address3
, City, State, Zip
FROM
(SELECT 'TABLE1' as tname, table1.ShipToNumber, table1.Name, table1.Address1
, table1.Address2, table1.Address3, table1.City, table1.State, table1.Zip FR
OM table1
UNION ALL
SELECT 'TABLE2' as tname, table2.ShipToNumber, table2.Name, table2.Address2,
table2.Address2, table2.Address3, table2.City, table2.State, table2.Zip FRO
M table2
)TMPTBL GROUP BY ShipToNumber, Name, Address1, Address2, Address3, City, Sta
te, Zip HAVING COUNT(*)=1 ORDER BY ShipToNumber
Hope this helps
--
Cheers,
JP (Just a programmer;)
----
A program is a device used to convert,
data into error messages
----
"JLS" <jlshoop@.hotmail.com> wrote in message news:e8wAsEZqFHA.3920@.TK2MSFTNG
P09.phx.gbl...
What is the best way to write a query to find a mismatch between 2 tables?
For instance, suppose you had 2 tables, each in a different database, but yo
u wanted to make sure the addresses in each table were in sync.
Table 1 = Ship To Number (PK), Name, Address1, Address2, Address3, City, Sta
te, Zip
Table 2 = Ship To Number (PK), Name, Address1, Address2, Address3, City, Sta
te, Zip
What is the syntax to find where a difference occurs between the 2 tables ?
I know how to write the query to join them and find difference if Address1 i
s different, where I am struggling is with Address1 or Address2 or Address3
or City or State or Zip is different.
I am thinking this has to be a subquery of some sort, but am totally drawing
a blank.
Any suggestions will be greatly appreciated.
jls|||You may find the CHECKSUM function useful for this task.
select *
from (select *, checksum(*) as cst1 from t1) as d1
join (select *, checksum(*) as cst2 from t2) as d2
on d1.keycol = d2.keycol
and cst1 <> cst2
You will probably find most mismatches with this code. Just keep in mind tha
t it's not 100% guaranteed that you will get all of them.
The CHECKSUM function might produce the same values for different inputs.
--
BG, SQL Server MVP
www.SolidQualityLearning.com
"JLS" <jlshoop@.hotmail.com> wrote in message news:e8wAsEZqFHA.3920@.TK2MSFTNG
P09.phx.gbl...
What is the best way to write a query to find a mismatch between 2 tables?
For instance, suppose you had 2 tables, each in a different database, but yo
u wanted to make sure the addresses in each table were in sync.
Table 1 = Ship To Number (PK), Name, Address1, Address2, Address3, City, Sta
te, Zip
Table 2 = Ship To Number (PK), Name, Address1, Address2, Address3, City, Sta
te, Zip
What is the syntax to find where a difference occurs between the 2 tables ?
I know how to write the query to join them and find difference if Address1 i
s different, where I am struggling is with Address1 or Address2 or Address3
or City or State or Zip is different.
I am thinking this has to be a subquery of some sort, but am totally drawing
a blank.
Any suggestions will be greatly appreciated.
jls