Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Friday, March 23, 2012

Link display in a report

How do I setup a link to only display when data is in the report I’m jumping to.

I don’t want to display the link if I don’t have any rows in the report.

You would probably have to set this up outside of the Report Manager portal, using a custom interface.

You may be able to get away with running a custom script that would query for the existence of data, and toggle security for individual reports that have no data.

This scripting tool may help with this task.

http://www.sqldbatips.com/showarticle.asp?ID=62

cheers,

Andrew

Monday, March 19, 2012

Line

Dear all,

I'm using a table to display my data and I need to draw a double line at the last textbox, may I know is it a way to have "double" line instead of "single" line drawing at one of my columns?

Thanks in advance

Levine

Hi,

The only way I have done this in my application is to create borders for the Table (Solid or Double) and then underline the last textbox item so that it slighlty looks different then the others.

Cheers,

Monday, March 12, 2012

Limiting Rows in a Report

I am having a table with 100 rows and i want to prepare a report in a
way that each page in the report want to display 10 rows in a page of
the report please say me the procedur for this .
thanks,
baba.If you have SQL 2K5, use ROW_NUMBER. If you're using SQL 2000, do a
self-join on the table. Here's a sample that runs on the Northwind DB:
SELECT COUNT(*) AS RowNumber, c.CustomerID, c.CompanyName, c.ContactName
FROM Customers c, Customers d
WHERE d.CustomerID <= c.CustomerID
GROUP BY c.CustomerID, c.CompanyName, c.ContactName
ORDER BY c.CustomerID
If you put this in a VIEW you can select where RowNumber between 1 and 10 to
grab the first ten; then RowNumber between 11 and 20 to grab the next 10,
etc.
"lucky" <j.v.s.s.baba@.gmail.com> wrote in message
news:1148564830.990338.67400@.j73g2000cwa.googlegroups.com...
>I am having a table with 100 rows and i want to prepare a report in a
> way that each page in the report want to display 10 rows in a page of
> the report please say me the procedur for this .
> thanks,
> baba.
>|||http://www.aspfaq.com/show.asp?id=2120
http://www.aspfaq.com/show.asp?id=2120
"lucky" <j.v.s.s.baba@.gmail.com> wrote in message
news:1148564830.990338.67400@.j73g2000cwa.googlegroups.com...
>I am having a table with 100 rows and i want to prepare a report in a
> way that each page in the report want to display 10 rows in a page of
> the report please say me the procedur for this .
> thanks,
> baba.
>

Friday, March 9, 2012

Limiting Number of Items Displayed in Report

ey there, quick question...

is there any way to limit the number of items displayed in a single page?

say i want to display up to 10 items, and then the rest of the items are then displayed on the next page?

any help and suggestions would be greatly appreciated.

thanks!

Tim

It's possible if you group on an expression rather than a field:

nest your table inside a list control|||thanks for replying sir

i got it already. thanks very much for your help|||I posted a working example in the other thread http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=157571&SiteID=1

Limiting Matrix Columns

I am dealing with a report which must display records in columns. The number of columns is dynamic as is the number of fields (rows) which will be displayed.
For example, my data is structured as follows:
ID Name Price State Category etc...
1 Widget $100 AL Tools
2 Gadget $45 NY Accessories
3 Thingy $12.50 TX Tools
etc.
.
.
In order to convert this to a matrix, I have queried the data to return in the following format:
ID Attribute Value
1 Name Widget
1 Price $100
1 State AL
1 Category Tools
2 Name Gadget
2 Price $45
2 State NY
2 Category Accessories
3 Name Thingy
3 Price $12.50
3 State TX
3 Category Tools
etc...
So, I create a matrix in my report with 1 column and 1 row. The column is grouped on ID. The row is grouped on Attribute. The detail displays the Value. Giving me:
1 2 3 etc...
Name Widget Gadget Thingy
Price $100 $45 $12.50
State AL NY TX
Category Tools Accessories Tools
etc...
This all works great and is very simple. The problem stems from the fact that I only want to display a limited number of columns on each page. Once 8 columns are displayed, I would like the matrix to skip to a new page, which redisplays my header. Unfortunately, the matrix just keeps expanding to the right and never wraps. Is there any way to work around this? Has anyone found a way to force a matrix to wrap and repeat the headers?
Thanks

Hello:

I have just sstayed away from Matrix'es in that I have no control. I have not found a way around your above example - maybe someone else knows but I sure don't - so I have just stayed with simple lists and have manipulated the data via a stored procedure with a "crosstab" or "pivot table" to generate the data (with respective columns) that I want and then within RS just layout the report visibility similar to a matrix.

A different subject for a different day but the same occurs within Analysis Services in that the horizontal presentation just extrapolates itself forever based upon the dimensions and columns - maybe I did not say that corectly but the same thing occurs.
So here is a nice little "generic" SQL that will allow you to present your row data as column data. A side Note - that is the ONLY issue I have with Reporting Services in that all data is always represented as a ROW - so this Stored Procedure will definitely help you control what you want to present.
There are some initial definitions you should deploy such as storing these parameters for each report within a table in SQL and if you want I can help you - but nevertheless here is the code and I rename this Stored Procedure for the name of my Reporting Services Report.
CREATE procedure Ex_CrossTab or whatever name you want (@.SQL varchar(2500),

@.PivotCol varchar(100),

@.Summaries varchar(100),

@.GroupBy varchar(100),

@.OtherFields varchar(150) = Null,

@.Debug bit = 0)

AS

set nocount on

set ansi_warnings off

declare @.Vals varchar(8000);

declare @.Vals2 varchar(8000);

declare @.Vals3 varchar(8000);

declare @.tmp varchar(1000);

declare @.TotalLen int;

set @.Vals = '';

set @.Vals2 = '';

set @.Vals3 = '';

set @.TotalLen = len(@.SQL) + len(@.GroupBy) + Len(ISNULL(@.OtherFields,''))

set @.OtherFields = isNull(', ' + @.OtherFields ,'')

create table #temp (Pivot varchar(100))

insert into #temp

exec ('select distinct convert(varchar(100),' + @.PivotCol + ') as Pivot FROM (' + @.SQL + ') A')

select @.tmp =

replace(replace(@.Summaries,'(','(CASE WHEN ' + @.PivotCol + '=''' + replace(Pivot,'''',''') +

''' THEN '),')[', ' END) as [' + Pivot ),

@.TotalLen = @.TotalLen + Len(@.tmp),

@.Vals = case when @.TotalLen < 7800 then @.Vals + ', ' + @.tmp else @.Vals end,

@.Vals2 = case when @.TotalLen between 7800 and 15799 then @.Vals2 + ', ' + @.tmp else @.Vals2 end,

@.Vals3 = case when @.TotalLen between 15800 and 23799 then @.Vals3 + ', ' + @.tmp else @.Vals3 end

from
#Temp
order by
Pivot

drop table #Temp

if (@.Debug=0)

exec ( 'select ' + @.GroupBy + @.OtherFields + @.Vals + @.Vals2 +

@.Vals3 + ' from (' + @.SQL + ') A GROUP BY ' + @.GroupBy)

else

begin

create table #Temp2 (SQLText Text);

insert into #Temp2 (SQLText)

values ('select ' + @.GroupBy + @.OtherFields + @.Vals + @.Vals2 +

@.Vals3 + ' from (' + @.SQL + ') A GROUP BY ' + @.GroupBy);

select * from #Temp2

end


set nocount off
set ansi_warnings on
GO

The above code executes your SQL statement as Dynamic SQL so make sure that you get rid of all blanks within your SQL because it is passed as a parameter to the above stored procedure. So use Query Analyzer and once again eliminate all "white" space and then pass your SQL statement as a parameter to the above stored procedure. Based upon your SQL Select you can eliminate the data that is returned thus "eliminating" your columns from extroploating within Reporting Services.
Definitions on how to use the above stored procedure are below:


Select
- This is the SQL statement or table you are querying. It can be any valid SELECT statement, with JOINS, WHERE clauses, TOP, etc -- anything that you can cut and paste into query analyzer and execute. (And, in fact, you should always do this when testing things out).

Friday, February 24, 2012

limit years from cube?

I have 10 years in my time dimension but I only want to display 5 of those
years in certain cube. How would I limit the number of years from a
dimension?Easiest way would be to use a standard SQL view for your dim in AS.
Ray Higdon MCSE, MCDBA, CCNA
--
"JJ" <swrothfuss@.hotmail.com> wrote in message
news:%23$avJRhBEHA.1544@.TK2MSFTNGP09.phx.gbl...
> I have 10 years in my time dimension but I only want to display 5 of those
> years in certain cube. How would I limit the number of years from a
> dimension?
>

limit the number of digits after decimal point in flaot data type

Hi..

I have a column in the data base with the type Float,

I want to limit the number of digits after decimal point to 2 when I display the value in ASP.NET but I don't know how!?

the number that appear after calculation llike "93.333333"

I use decimal(2,2) as data type but an error accour and this is the message

"- Unable to modify table.
Arithmetic overflow error converting float to data type numeric.
The statement has been terminated."

Can you help me..

thanks

Hi..


Before saving to database you can use String.Format() method to modify your float value.

First you need to convert float into string using

String myStr = Convert.ToString(yourFloatHere);

And then use String.Format("{0:N}", myStr);

and then again convert it into float using COnvert.ToDouble(MyStr);

Cheers n Hope it would help

|||

Hi..

I try what you suggest but the following error produced:

Cannot implicitly convert type 'double' to 'float'. An explicit conversion exists (are you missing a cast?)

Do you konw its solution?!

This is my code:

//------------------

float temp;

String value;

SqlConnection con =newSqlConnection(@."Data Source=localhost ;Initial Catalog=university ;Integrated Security=True");

con.Open();

SqlCommand cmd =newSqlCommand("select SUM(FinalGrid)/COUNT(FinalGrid)from studentSections Where studentSection_UserID='" + Session["ID"].ToString() +"'", con);

SqlDataReader reader = cmd.ExecuteReader();

while (reader.Read())

{

value =Convert.ToString(reader[0]);

}

String.Format("{0:2}", value);temp =Convert.ToDouble(value); //Here is the error

reader.Close();

//------------------------

Is it has any wrong?!

|||

Do not use the decimal(2,2). Just have the way it is now and just modify the SQL statment that you use to retrive the data and include the function

STR(columnname, lenght, number of decimal places)

This function will automatically round the data in this column to number of decimal places u want when the data is returned to ur ASP.NET application.

|||

Hi..

Can you tell me where I should use this function? and what do you mean by "length" ?

|||

Suppose you are using the query "select column1 from table1" to get the data to your applicaiton, where column1 is the one where you want only 2 decimals

u will have to use it as "select str(column1,10,2) as column1 from table1"

this will make sure you have only 2 decimals in the data that is returned, if there are more than 2 , it will round it to 2 decimals.

|||

Thanks so much its work very nice

Monday, February 20, 2012

limit record

hi everybody,
Beside top statement what is the best statement used to limit the display the data?
Thanks...Where

Having

Look them up in BOL|||You can also use SET ROWCOUNT, which can also be found in Books Online.|||thans for the replys guys, One more question here can I use set row count in my vb app without using stored procedure?

thank|||thans for the replys guys, One more question here can I use set row count in my vb app without using stored procedure?

thankSometimes you can, sometimes you can't. The SET ROWCOUNT command is a SQL Server specific command, that affects the current connection. If your application uses connection pooling, it is unsafe to use SET ROWCOUNT outside of a stored procedure.

-PatP