0

Hi

I did the stored procedure in mssql 2012. working fine in server.

I have an issue that I need the output of my SP into HTML Report Format in aspx.page with Sub and Grand Total
I no need GridView

Pls advice

Maideen
My SP

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[Z_usp_Circ_Details_Member]

AS
BEGIN

    SET NOCOUNT ON;
    SELECT * FROM (SELECT 
    MEMBER,[LANGUAGE],[TYPE],[PLATFORM],copies,CATEGORY,MAINAREA,YearNo
    FROM Z_tbl_Circulation_Details where mainarea='Peninsular Malaysia' and Language='English') TableYearNo
    pivot (Sum(copies) for [member] in ([The sun],[The Star]))pivotTable
END

Results

English Newspaper   Print   Free    Peninsular Malaysia 2012    603706  5210
English Newspaper   Print   Free    Peninsular Malaysia 2013    301853  98754
English Newspaper   Print   Paid    Peninsular Malaysia 2012    2547    569146
English Newspaper   Print   Paid    Peninsular Malaysia 2013    3257    284573
3
Contributors
2
Replies
16
Views
3 Years
Discussion Span
Last Post by gudegjawa
0

If you want the HTML directly from the SP, you can do something like:

SELECT 
   '<tr><td>' + MEMBER + '</td><td>' + [LANGUAGE] + '</td><td>' + [TYPE] + '</td></tr>'...

But it's much more elegant if you use and asp:Template or even a foreach loop to create your html.
Databases are supposed to return data, not html.

0

for the first, you can get all your store procedure data at your code and store the data on new class or array.
after that, parse class data to your HTML

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.