Report Template With Totals??

Apr 19, 2007

Hello All,



Can someone tell me how to achieve this template of the report:

Initially when not expanded

+Item number

- - - - - -(these are summed values)

After expnading the fields(+)



-Item number

-item name

[ (details)

[ (details)

[ (details)

- - - -(summed values)



Right now, I can achive the second scenario (expanded one) but initially my report just comes up with

+Item number

and the second line (summed values) are not in there . Any sort of help will be appreciated.

Thanks,

Rashi

View 3 Replies


ADVERTISEMENT

'Dynamic Time(year,month,date)' Report Template (rdl) Using Report Designer VS2005

Jan 19, 2007

I have three types of specific reports that i have to create with the input parameters (range) either

1: By date (rdl 1)

2.By Month (rdl 2)

3.By Year (rdl 3)

Is it possible ( or how do I ) to create just one report template ( one rdl) with the three sets of parameters ( hiding/invisible which ever two sets base on user selection) and the output of the report will display the desired type( either by year, month or date).

I ask this because its possible to create a drill down report from year down to date etc in report designer (vs 2005). Not sure if I can create one instead of three rdls and with the 'logic' built within that template.

Thanks

Regards

Alu

View 4 Replies View Related

Reporting Services :: Row Group Totals On A Drill Down Report Builder Report

Oct 28, 2015

I have a report builder drill down report. I have row groups with totals.    It looks like the attached.   The problem is when the report is not expanded the Grand Totals column is not accurate... it is displaying the totals of one of the rows when expanded.The expression in the Total Show text box is

= Switch (                                                                      
MID(Fields!protocol_id.Value,1,7)="THERAPY",                    
                                         Sum(IIF(Fields!status.Value = "CO", CDbl(Fields!TX_CO.Value),           Nothing)),
  MID(Fields!protocol_id.Value,1,7) = "GENERAL" and                                                  MID(Fields!program_id.Value,1,6)
= "INTAKE",                                                        Sum(IIF(Fields!status.Value = "CO",

[code]...

Is there any way to not display the expression in the Total columns unless the report is expanded?

View 2 Replies View Related

Creating Report Template

Jan 16, 2007

HI
I want to create a report template in SQL Server 2005 Reporting Services.
The template will have a fixed header and footer.I want to use this template in all my reports.
How to do so?

View 2 Replies View Related

Where Is Report Server Project Template?

Feb 27, 2007

From file, new, project, I did not see Project types.
Where is Report server project template?
How to make it appear?

View 2 Replies View Related

Report Model Template Is Missing

Jul 26, 2007

I want to create a new report model project, however in VS Business intelligence Development Studio, I could find the report model template in the New project dialog box. Anyone coulf tell me how can I add the templeate? Thanks

View 1 Replies View Related

Is It Possible To Modify Report Builder Template ?

May 8, 2006

Hi

I would like to be able to modify the basic report template offered by Report Builder , so as to be able to include custom fields that I would like to be present in every report (Company name , Logo , Date , etc) to achieve consistency in the presentation of the reports created with Report Builder

In Bob's Blog he explained how to include RDL expressions in Report Builder
http://blogs.msdn.com/bobmeyers/archive/2006/03/26/561147.aspx

What I would like to do is to use that technique (if possible) to modify the original template or templates offered by Report Builder to include my own fields.

============================================

I will appreciate some comments or suggestions about other approaches that can be used to address the issue mentioned in the first paragraph .

Thanks in advance ,

George

View 9 Replies View Related

Custom Report Server Project Template

Dec 8, 2007

Hi,


is it possible to create a report server project template ? This project must have 2 datasources and 1 specific report
I wanted to use the Export Template, but it isn't available. I can only use it in Developpement Studio not in BIDS.


Thanks to help me


Cédric

View 3 Replies View Related

Reporting Services :: Report Return Only Template

Oct 8, 2015

I have problem with report. I create report that retrieve data depend on parameter that application pass to it. At first it worked fine. After couple of times that I run my report for different parameters for test results that I get, report start return only template without no data. I don't change nothing in report , but it stop to work right way even for parameters that I pass at first.

View 3 Replies View Related

Complicated Report Template (multi-columns Subreport?)

Feb 10, 2008

Hi everyone,


We are working on a some required report templates and we are in a some deadlock now... We need to desing report templates something like on the image below. There are some data at the left and top (grey rectangles) and dynamic information from a datasource in the middle (actually a list - green rectangles). Our idea was to use a subreport to design required list, but the problem is that subreport does not support multi-columns layout (really very 'interesting' limitation from Microsoft's guys)... Does somebody have a some ideas how to design this report using MS SQL Reporting Services 2005?

http://www.upload-images.net/imagen/de18948ff6.jpg

View 3 Replies View Related

Report Model Template Not Available Within Visual Studio 2005

Apr 4, 2007

When I launch Visual Studio 2005 and choose to start a new project...I expect to see "Report Model" as an available template (at least that is what my book says).



How can I install this?



Why is it missing? Is it due to the order of my installations? I installed RS first then Visual Studio.



Any help is appreciated.



Thanks

View 1 Replies View Related

Matrix Report With Totals

Apr 1, 2007

Hi,

Is there a tutorial on how to do a matrix report with row & column tables? This is easy on by default in Crystal, but I can't figure out how to do it in RS.

Thanks,
John

View 2 Replies View Related

Different Totals In A Matrix Report

Aug 21, 2007

I have a matrix report with 2 column Groups and 2 Row Groups ,I need to calculate the Subtotals at Row Group2

2007
JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC TOTAL

Current Period Total 1211 1813 3040 1699
CB 1062 1551 2527 1517
BR 149 262 513 182
Prior Year Total 1528 1894 3238 1676
CB 1276 1540 2521 1400
BR 252 354 717 276
Prior Year Chg% Total <the Total here Should not be a sum of the individual percents but a Calculated percentage>
CB -16.77 0.71
BR -40.87 -25.99



With this Matrix this is what i have in the cell

=iif (InScope("matrix1_Ddat_Prod_Mth_Nm"),

iif(InScope("matrix1_Date_Calculations"),iif(fields!Date_Calculations.Value = "Current Period",

iif(fields!Ddat_Prod_Mth_Nbr.Value > Month(Today),COBJ("-"),

Round(Sum(Fields!RecruitsCount.Value),2)),

iif(fields!Date_Calculations.Value = "Prior Year Chg %",

iif(fields!Ddat_Prod_Mth_Nbr.Value > Month(Today),"-",

iif(fields!Ddat_Prod_Mth_Nbr.Value <= Month(Today) And fields!RecruitsCount.value = -100,

"-", Round(Sum(Fields!RecruitsCount.Value),2))),Round(Sum(Fields!RecruitsCount.Value),2))),

iif(Fields!Date_Calculations.Value= "Current Period",

iif(Fields!RecruitsCount.Value= 0,"-",Sum(Fields!RecruitsCount.value)),

iif(Fields!Date_Calculations.Value= "Prior Year",Sum(Fields!RecruitsCount.value),

iif(Fields!Date_Calculations.Value="Prior Year Chg %",iif(ASC(Fields!RecruitsCount.Value)= ASC("-"),"-",Round(First(Fields!RecruitsCount.Value),2)),0)))),

iif(InScope("matrix1_Date_Calculations"),Round(Sum(Fields!RecruitsCount.Value),2),Round(Sum(Fields!RecruitsCount.Value),2)))

i have to replace the red strip with a calculated function that would return a total percentage for that row .

I am using AS 2005 as datasource for this , the AS2005 has the totals calculated but i am not able to pull them into the reporting services .
here is the MDX for that

WITH MEMBER [Measures].[Avg Monthly] AS 'AVG(Descendants([DimDate].[Fiscal Hierarchy].Currentmember),[Measures].[RecruitsCount])' MEMBER [Measures].[Total Prior Year] AS 'Sum([dimdateCalculations].[Prior Year])'
SELECT { [Measures].[RecruitsCount] } ON COLUMNS,
{ ([dimDate].[Fiscal Hierarchy].[Ddat Prod Mth Nbr].ALLMEMBERS
* [Date Calculations].[Date Calculations].ALLMEMBERS
* [dimWritingNumber].[Dwnb Broker Ind].[Dwnb Broker Ind].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( STRTOSET(@dimDateDdatProdYrNbr, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLowestLvlConsolIDNo, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo7, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo6, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo5, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo4, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo3, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo2, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchLvlConsolIDNo, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchTdNm, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@dimProdChainDpchCompanyCd, CONSTRAINED) ) ON COLUMNS
FROM [MRSCUBE])))))))))))
WHERE
( IIF( STRTOSET(@dimProdChainDpchCompanyCd, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchCompanyCd, CONSTRAINED), [dimProdChain].[Dpch Company Cd].currentmember ),
IIF( STRTOSET(@dimProdChainDpchTdNm, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchTdNm, CONSTRAINED), [dimProdChain].[Dpch Td Nm].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo, CONSTRAINED), [dimProdChain].[Dpch Lvl50 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo2, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo2, CONSTRAINED), [dimProdChain].[Dpch Lvl49 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo3, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo3, CONSTRAINED), [dimProdChain].[Dpch Lvl46 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo4, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo4, CONSTRAINED), [dimProdChain].[Dpch Lvl45 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo5, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo5, CONSTRAINED), [dimProdChain].[Dpch Lvl40 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo6, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo6, CONSTRAINED), [dimProdChain].[Dpch Lvl30 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLvlConsolIDNo7, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLvlConsolIDNo7, CONSTRAINED), [dimProdChain].[Dpch Lvl29 Consol ID No].currentmember ),
IIF( STRTOSET(@dimProdChainDpchLowestLvlConsolIDNo, CONSTRAINED).Count = 1,
STRTOSET(@dimProdChainDpchLowestLvlConsolIDNo, CONSTRAINED), [dimProdChain].[Dpch Lowest Lvl Consol ID No].currentmember ),
IIF( STRTOSET(@dimDateDdatProdYrNbr, CONSTRAINED).Count = 1,
STRTOSET(@dimDateDdatProdYrNbr, CONSTRAINED), [dimDate].[Ddat Prod Yr Nbr].currentmember ) )
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS


Please help . Thank you

View 2 Replies View Related

Adding Totals To Report

Apr 22, 2008

Hi There,


I have the following query:

SELECT NATNLACCT, IDCUST, TEXTSNAM, AMT
FROM
VIEW_ARCUS
where amtbaldueh != .000
order by NATNLACCT

but i want to display the data something similar as below. How do I create the total lines after each natinlacct grouping? I don't know how to add it in the report layout. I have the columns data and grouping right but I'm just not getting how to add that total line after every group.

Natinlacct idcust textsnam amt


Doda 1234 abcd $101

Doda 5678 efgh $200
Doda 9876 ijkl $300

Doda Total $601

Nava 5847 jhgf $230

Nava 5487 lfde $130
Nava 3587 lrsd $100

Nava Total $460

Thanks
Rhonda

View 3 Replies View Related

Can Not See Report Model Template In Business Intelligent Project Templates

Mar 31, 2007

Hi all,

I desperately need to setup the AD-HOC reporting on SQL server 2005.
I think one of the templates that I need is in Business Intelligent Project Templets Reporting Model Template in Visual Studio Templates.

But I do not see it in there.
Can some one please let me know where can I get the Reporting Model Template, or a link to where I can download or how to create it.

Thanks or any help.


Abrahim

View 3 Replies View Related

Cumulative Totals In Chart : Report Builder

Jan 24, 2007

Hi,

I am trying to display a line chart with cumulative totals over period of 12 months in a fiscal year. I know this can be achieveable in report designer using "Running value function".

Any idea how to achieve the same in Report builder ?

thanks in advance.

Here is the data :

Month Count

July 2

Aug 3

Sept 2



Expected output should be

Month Count

July 2

Aug 5(July count + Aug.Count)

Sept 7(July count + Aug count + Sept Count)

Regards,

bala

View 1 Replies View Related

Reporting Services :: Group Totals From Report Items

May 18, 2015

I have a table with a row group "Sales Area" that lists customers per sales area. There is one column with the sales per customer and another column with the planned sales per customer.A third column "Under Plan" is a simple calculation that compares the two Report Items of the sales to the plan and puts a 1 there if plan is higher. My issue is how to get the total of the group "Sales Area", to display the group total of all customers that are under plan. SSRS doesn't let me use aggregate functions on group totals;Unfortunately I cannot pre-calculate the "Under Plan" figure in the query, since this example is a simplified overview (the customers is a distinct count for example...)

View 5 Replies View Related

Reporting Services :: Sort Report By Totals Column

Jan 4, 2012

I've created an SSRS report in Report builder and I'm displaying it in SharePoint 2010. What I would need to do is to sort according to my totals -column. My report structure is as follows:

The first and column second columns are the ID and the name of a customer. There are over 35.000 consolidated customers in the database.

The third column is the column which I would like my report to be sorted upon. It gives the sum (Amount_EUR) of all different productlines sold to the customer.

The fourth column in this report design model is the product groups sold to that customer. There over twenty of product groups visible when Running the report.

This is what my report looks like when finished (you'd have to scroll a lot to the right if I took the whole of the report so I cut only a part of it to be visible):

I tried to add a sorting option from the reports Tablix properties and adding this code as the sorting function:

=SUM(Fields!Amount_EUR.Value)

But I'm getting an error:  "A sort expression for the tablix 'Tablix1' includes an aggregate function.  Aggregate functions cannot be used in data row sort expressions."

Ok, so no aggregate functions aren't allowed to the sort.

If I just put:

=Fields!Amount_EUR.Value and sort by that from Z to A(biggest to largest) it doesn't have any effect. The report is still sorted alphabetically by the ParentID.

I've also tried some other code bits, but they all seem to be saying that I couldn't put an aggregate function into the sort expression....but my Total -column is already calculated with a Sum -function....

Is it possible sort my report based on that Total -column? If yes, how? I'm using SSRS 2008

View 4 Replies View Related

Running Totals In A Report Builder Column Chart

Mar 9, 2006

I've created a Report Builder Column chart with months as the x-axis
(category) and revenue as the y-axis (value). This correctly displays
the revenue for each month, but I'd like to display a running total of
the revenue for the year.

I'm currently displaying:
Jan $2
Feb $1
Mar $4


I want to display:
Jan $2
Feb $3
Mar $7


I know this is possibly using the RunningTotal formula in Reporting
Services, but I'd like to do this in Report Builder so the users can
change and create their own graphs with running totals. Is there a way to do this in Report Builder?

Thanks.

View 1 Replies View Related

Reporting Services :: Calculating Grand Totals From Group Totals

May 9, 2015

I have some data grouped in a table by a certain criteria, and for each group it is computed a subtotal for the group. Of the values from each of the group, I want to create a grand total on the report by adding every subtotal from each group.

Example:
...
....
Group1              Value
                           10
                            20
Sub Total 1:         30

Group2                 Value
                              15
                              25
Sub Total 2:           40

Now, I would like to be able to add subtotal 1 (30) to subtotal 2 (40) and my grand total would be 70. Can I accomplish this task in SSRS?

View 5 Replies View Related

Trying To Get Daily Totals From Cumulative Totals In A Pivot

Oct 2, 2006

I have been providing sales data for a few months now from a table that is set up like this:

Date WorkDay GasSales EquipmentSales

9/1/2006 1 100.00 200.00

9/4/2006 2 50.00 45.00

etc.

As can be seen, the data is daily, i.e., on the first workday of September we sold one hundred dollars in gas and two hundred dollars in equipment. On the second workday of September we sold fifty dollars in gas and forty-five dollars in equipment.

Now, however, the data I have to pull from is cumulative. So, using the last table as an example it would look like this:

Date_WorkDay_GasSales_EquipmentSales

9/1/2006 1 100.00 200.00

9/4/2006 2 150.00 245.00

etc.

To make things more complicated, the powers that be wanted this data presented in this fashion:

Total Sales:

1_2_etc.

300.00 95.00 etc.

 So, I have been doing a pivot on a CRT to get the data to look like I want. The code is like this:

with SalesCTE (Month, WorkDay, [Total Sales])

as

(

SELECT

datename(month, cag.date),

cag.WorkDay AS [Work Day],

sum(cag.sales_gas + cag.sales_hgs) AS [Total Sales]

FROM CAG INNER JOIN

Branch ON CAG.[Oracle Branch] = Branch.OracleBranch

group by cag.date, cag.WorkDay

)

select * from SalesCTE

pivot

(

sum([Total Sales])

for WorkDay

in ([1],[2],[3],[4],[5],,[7],,[9],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19],[20],[21],[22],[23])

) as p

So, my question is:

How do I get the data to give back daily totals instead of the cumulative amounts for each workday? If the query was a simple one, I'd do something like

select [1] as [Day 1], [2]-[1] as [Day 2], [3]-[2] as [Day 3], etc.

but the query is far from normal, with the CRT and the pivot. I can't seem to get it to work how I'd like.

Any advice/answers? Thanks in advance!!!

 

P.S. I don't know how to get it to quit with the freakin' smileys.... I suppose you can figure out what my code is really supposed to look like above. Needless to say, it doesn't include a devil face and a damn music note...

View 12 Replies View Related

Report Services 2000 Totals On Group Are Incorrect. Summing Duplicate Values

Dec 19, 2007

Hello Everyone
I've created a report with a simple dataset that is similar to this

City , RequestID, Request Amount, ClaimID, ClaimAmount
El Monte 791 52,982.00 2157 41,143.75
El Monte 3691 11,838.00 3140 8,231.14
El Monte 3691 11,838.00 3141 990.00
El Monte 3691 11,838.00 3142 2,615.00


So I group by City, RequestID. On the first group I specified the expression to be City and in the header I list the city and in the footer I list the sum of Request amount. On the second group I specified the group by Request so in the header I placed requestID and on the footer I placed Request Amount. I set request information to hide the duplicates and I even add =Sum(Fields!RequestApprovedGrandTotal.Value,"GroupByRequestID") the scope of the group. But this is what I get:


For requestID = 3691 for Request Amount is 35,514.00 not 11,838.00. All the claim sums are correct and they are located on the detail row.



I've read that a work around is to create multiple dataset but I honestly believe that something as simple as this should work on the reporting server 2000. So I've come to the conclusion that I must be doing something wrong. Can someone give me a hand on this. Thanks.

View 6 Replies View Related

Sp Template

Sep 4, 2006

Somehow I have saved an sp as a template - how do I delete it ?

View 4 Replies View Related

DTS Project Template Not Available?

Jan 19, 2006

I need to import data from a CSV file into a db I'm designing.  I figured I'd use DTS (which I understand now uses VS in the form of a 'Business Intelligence' (BI) project).  My problem is that my only choices for BI projects are:
Analysis Service Project, Import Analysis Services 9.0 Database, Integration Services Project, Report Server Project Wizard, Report Model Project, Report Server Project.
No "Data Transformation Project".
I have SQL Server 2005 Developer's Edition.  Might it be that DTS is not included in that version?
If I can't use DTS, what choices do I have?

View 2 Replies View Related

Database Template

Feb 14, 2001

Hi! I'm new to SQL Server 7 and I hope I could get some help. I'd like to duplicate an empty database and use the duplicate for the transactions. I want the empty database to somehow act like a template so, whenever I want to, I could create a new instance of it. Problem is I don't know if it is possible to do that on SQL server (it's possible in Access). If it is possible, I hope any of you could tell me how. Thanks.

View 1 Replies View Related

How Do I Run Logtemp.sql Template

Apr 5, 2000

Hello,

I'm having a hard time trying to figure out how to run the logtemp.sql script that is included with IIS4 for ODBC logging. Any help would be appreciated.

View 2 Replies View Related

Save As Template?

Jan 29, 2004

In Enterprise Manager when I bring up Trigger Properties there is an active button titled "Save as Template". But when I switch to an existing trigger the button is disabled. Oddly, the Help file for the dialog box doesn't even mention this button.

Anybody know what this does, how it works, or why it would be usefull? Any references to The Holy Book would be helpfull.

View 14 Replies View Related

TOP X Query In Xml Template

May 6, 2004

HI,

how can I specify the number of records that have to be sent back dynamically in an Xml Template?

I am currently busy developing a client-server application that pulls data from an Sql Server via Xml. If the client application has a bad connection to the server, the program has to get the data in small portions.

When I use:

SELECT TOP @amount *
FROM employees

I get the error: syntax near '@amount'.

The query fails as wel when I tried to use:

SET ROWCOUNT @amount

SELECT *
FROM employees

SET ROWCOUNT 0

This works fine in Sql analyser, but sql doesn't allow the integers to be parameters and casting them to int does not work either.

thanks for your help!

View 3 Replies View Related

Header Template

Mar 5, 2007

Hi all. How to make a template header for reports please? So that everytime I make a report, ill just call the template in the header.
Thanks.
-Ron-

View 3 Replies View Related

Template Explorer

Nov 7, 2007

Hi,
Is there any way to change path for template explorer? Default path for SQL templates is ..Application DataMicrosoftMicrosoft SQL Server90ToolsShellTemplatesSql. I have scripts & would like to share with my teammates. Is there any way to set this path to a common folder so that whenever anybody connects with their login to our TS server, they should be able to see these scripts in template explorer.

Thanks in advance
Sandesh

View 2 Replies View Related

Template Function

Oct 10, 2005

Hi,Suppose I have a table something like:name (VARCHAR(64)) age (INT) quotation (TEXT)=================================================Donald Trump 50 I am richBugs Bunny 26 What's up doc...and a template string something like:SET @template = 'My name is {name}, my age is {age}, and I always say"{quotation}".'I'd like to be able to dynamically replace the placeholders in thetemplate string with values extracted from the corresponding columns inthe table, so I'd get a set of results like:'My name is Donald Trump, my age is 50, and I always say "I am rich".'The best I've come up with so far is:SET @Query = 'SELECT '''+ REPLACE(REPLACE(@String, '{', '''+CONVERT(varchar,'),'}', ')+''')+ ''' FROM Table'EXEC (@Query)This converts the template string into a query string, castingeverything to avarchar to allow numeric values to work. In this case it would be:SELECT 'My name is '+CONVERT(varchar,name)+', my age is '+CONVERT(varchar,age)+', and I always say "'+CONVERT(varchar,quotation)+'".'The problem with this is that if the length of a varchar isunspecified, it defaults to 30, which truncates long string values.Can anyone figure out a way round this, or perhaps an alternativemethod entirely?--Oli

View 5 Replies View Related

Bad Proc Template

Jul 28, 2006

There is a base-installed template for a stored procedure called "Create Procedure with CURSOR OUT" which has this snippet:


EXEC <Schema_Name, sysname, Schema_Name>.<Procedure_Name, sysname, Procedure_Name> <@proc_cursor_name, , @sample_procedure_cursor> = <@variable_cursor_name, , @test_cursor_variable> OUTPUT

WHILE (@@FETCH_STATUS = 0)

BEGIN

FETCH NEXT FROM <@variable_cursor_name, , @test_cursor_variable>

PRINT 'put user defined code here'

END
But even after instantiating it - it doesn't work. The "FETCH_STATUS" must be seeded with a prior "FETCH" before it has any meaning. This leads me to ask: (1) how could such a widely circulated template have such a conspicuous error and (2) why doesn't TSQL have a looping mechanism that does not require such awkward FETCH "pre-seeding"?
p.s. How do I insert code into a forum post that is single-spaced, rather than duoble-spaced (like my ugly double-spaced snippet above)

View 1 Replies View Related

Using RS 2000 As A Template

Feb 22, 2007

I have created a template like report which is all working correctly. The report shows a order slip for all orders that are in a certain pick, and has a list of all products for each order. (so a list of products is printed for each order in the pick)

The question I have is, when the order is very long ie doesnt fit in 1 page, I need someway of the user easily knowing that there is more than 1 page... ie it should be Page 1 of 2... but in the whole report it may be Page 56 of 60.... is there a way of doing this??? or something similar...

I hope i have made myself clear... and would be VERY garteful for any ideas, im bit lost!...



Thanks

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved