CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Page not Work in Grid after change table to sql datasource

Print topic Send  topic

Author Message
Muhd fauzi
Posted: 01/10/2005, 11:00 PM

I have a grid which work fine when datasource is table. But when changed to sql, the pagination only shows page 1 and no other page. The sql as shown below:

SELECT AreaA.areaid AS AreaA_areaid, AreaA.parentarea AS AreaA_parentarea,
bearerid, swa, swb, capacity, networktype, ccttype, spantype,
workprot, nwbearer.datasrce AS nwbearer_datasrce, admin_status, portcapacity, portcount, StationA.stationid AS StationA_stationid,
StationA.tmolnos AS StationA_tmolnos, AreaB.areaid AS AreaB_areaid,
AreaB.parentarea AS AreaB_parentarea, StationB.stationid AS StationB_stationid,
StationB.tmolnos AS StationB_tmolnos, SpeedTrid_key, speedpk, TribSpeed, TribPortAllowed ,
count(bearerid ) as cctcount
FROM ((((nwbearer INNER JOIN pystation StationB ON
StationB.stationid = nwbearer.stationb) INNER JOIN pystation StationA ON
StationA.stationid = nwbearer.stationa) INNER JOIN rfspeedtrib ON
nwbearer.SpeedTrib_key = rfspeedtrib.SpeedTrid_key) INNER JOIN area AreaB ON
AreaB.areaid = StationB.areaid) INNER JOIN area AreaA ON
StationA.areaid = AreaA.areaid
WHERE ( AreaA.parentarea LIKE '%{s_AreaA_parentarea}%'
or Areab.parentarea LIKE '%{s_AreaA_parentarea}%' )
AND networktype LIKE '%{s_networktype}%'
AND ccttype LIKE '%{s_ccttype}%'
AND speedpk LIKE '%{s_speedpk}%'
group by AreaA_parentarea, Areab_parentarea,
speedpk, TribSpeed, TribPortAllowed , networktype, ccttype
ORDER BY AreaA_parentarea, Areab_parentarea, speedpk, TribSpeed, TribPortAllowed , networktype, ccttype


Can anybody explain on how ccs pagination works and how to fix this problem.

peterr


Posts: 5971
Posted: 01/10/2005, 11:08 PM

In some cases CCS may be unable to create a correct SQL count statement that calculates the number of total records and the CountSQL property is provided specifically for this reason.
Take a look at:
http://docs.codecharge.com/studio/html/Components/RTPro...P/CountSQL.html
http://docs.codecharge.com/studio/html/ProgrammingTechn...yingOutput.html (you can display and modify datasource.CountSQL instead of datasource.SQL)
http://forums.codecharge.com/posts.php?post_id=48338
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Muhd Fauzi
Posted: 01/11/2005, 1:00 AM

Peter,
I've tried with countsql as below:

Function area_AreaA_nwbearer_pysta_DataSource_BeforeBuildSelect() 'area_AreaA_nwbearer_pysta_DataSource_BeforeBuildSelect @15-A012AC71

'Custom Code @151-73254650
' -------------------------
' Write your own code here.
' -------------------------
area_AreaA_nwbearer_pysta.DataSource.countSql = "SELECT AreaA.areaid AS AreaA_areaid, AreaA.parentarea AS AreaA_parentarea,bearerid, swa, swb, capacity, networktype, ccttype, spantype,workprot, nwbearer.datasrce AS nwbearer_datasrce, admin_status, portcapacity, portcount, StationA.stationid AS StationA_stationid,StationA.tmolnos AS StationA_tmolnos, AreaB.areaid AS AreaB_areaid,AreaB.parentarea AS AreaB_parentarea, StationB.stationid AS StationB_stationid,StationB.tmolnos AS StationB_tmolnos, SpeedTrid_key, speedpk, TribSpeed, TribPortAllowed ,count(bearerid ) as cctcountcFROM ((((nwbearer INNER JOIN pystation StationB ONcStationB.stationid = nwbearer.stationb) INNER JOIN pystation StationA ONcStationA.stationid = nwbearer.stationa) INNER JOIN rfspeedtrib ONcnwbearer.SpeedTrib_key = rfspeedtrib.SpeedTrid_key) INNER JOIN area AreaB ON AreaB.areaid = StationB.areaid) INNER JOIN area AreaA ON StationA.areaid = AreaA.areaid group by AreaA_parentarea, Areab_parentarea, speedpk, TribSpeed, TribPortAllowed , networktype, ccttype"

'End Custom Code

End Function


and the sql statement as below:

SELECT AreaA.areaid AS AreaA_areaid, AreaA.parentarea AS AreaA_parentarea,
bearerid, swa, swb, capacity, networktype, ccttype, spantype,
workprot, nwbearer.datasrce AS nwbearer_datasrce, admin_status, portcapacity, portcount, StationA.stationid AS StationA_stationid,
StationA.tmolnos AS StationA_tmolnos, AreaB.areaid AS AreaB_areaid,
AreaB.parentarea AS AreaB_parentarea, StationB.stationid AS StationB_stationid,
StationB.tmolnos AS StationB_tmolnos, SpeedTrid_key, speedpk, TribSpeed, TribPortAllowed ,
count(bearerid ) as cctcount
FROM ((((nwbearer INNER JOIN pystation StationB ON
StationB.stationid = nwbearer.stationb) INNER JOIN pystation StationA ON
StationA.stationid = nwbearer.stationa) INNER JOIN rfspeedtrib ON
nwbearer.SpeedTrib_key = rfspeedtrib.SpeedTrid_key) INNER JOIN area AreaB ON
AreaB.areaid = StationB.areaid) INNER JOIN area AreaA ON
StationA.areaid = AreaA.areaid
WHERE ( AreaA.parentarea LIKE '%{s_AreaA_parentarea}%'
or Areab.parentarea LIKE '%{s_AreaA_parentarea}%' )
AND networktype LIKE '%{s_networktype}%'
AND ccttype LIKE '%{s_ccttype}%'
AND speedpk LIKE '%{s_speedpk}%'
group by AreaA_parentarea, Areab_parentarea,
speedpk, TribSpeed, TribPortAllowed , networktype, ccttype



But it still does not work. Help pls
Stefano Chermaz
Posted: 01/12/2005, 6:34 AM

Try with:

area_AreaA_nwbearer_pysta.DataSource.countSql = "SELECT count(*) FROM
((((nwbearer INNER JOIN pystation StationB ONcStationB.stationid =
nwbearer.stationb) INNER JOIN pystation StationA ONcStationA.stationid =
nwbearer.stationa) INNER JOIN rfspeedtrib ONcnwbearer.SpeedTrib_key =
rfspeedtrib.SpeedTrid_key) INNER JOIN area AreaB ON AreaB.areaid =
StationB.areaid) INNER JOIN area AreaA ON StationA.areaid = AreaA.areaid
group
by AreaA_parentarea, Areab_parentarea, speedpk, TribSpeed, TribPortAllowed ,
networktype, ccttype"

Bye, Stefano
<MuhdFauzi@forum.codecharge (Muhd Fauzi)> wrote in message
news:641e395b30099d@news.codecharge.com...
> Peter,
> I've tried with countsql as below:
>
> Function area_AreaA_nwbearer_pysta_DataSource_BeforeBuildSelect()
> 'area_AreaA_nwbearer_pysta_DataSource_BeforeBuildSelect @15-A012AC71
>
> 'Custom Code @151-73254650
> ' -------------------------
> ' Write your own code here.
> ' -------------------------
> area_AreaA_nwbearer_pysta.DataSource.countSql = "SELECT AreaA.areaid AS
> AreaA_areaid, AreaA.parentarea AS AreaA_parentarea,bearerid, swa, swb,
> capacity, networktype, ccttype, spantype,workprot, nwbearer.datasrce AS
> nwbearer_datasrce, admin_status, portcapacity, portcount,
StationA.stationid AS
> StationA_stationid,StationA.tmolnos AS StationA_tmolnos, AreaB.areaid AS
> AreaB_areaid,AreaB.parentarea AS AreaB_parentarea, StationB.stationid AS
> StationB_stationid,StationB.tmolnos AS StationB_tmolnos, SpeedTrid_key,
> speedpk, TribSpeed, TribPortAllowed ,count(bearerid ) as cctcountcFROM
> ((((nwbearer INNER JOIN pystation StationB ONcStationB.stationid =
> nwbearer.stationb) INNER JOIN pystation StationA ONcStationA.stationid =
> nwbearer.stationa) INNER JOIN rfspeedtrib ONcnwbearer.SpeedTrib_key =
> rfspeedtrib.SpeedTrid_key) INNER JOIN area AreaB ON AreaB.areaid =
> StationB.areaid) INNER JOIN area AreaA ON StationA.areaid = AreaA.areaid
group
> by AreaA_parentarea, Areab_parentarea, speedpk, TribSpeed, TribPortAllowed
,
> networktype, ccttype"
>
> 'End Custom Code
>
> End Function
>
>
> and the sql statement as below:
>
> SELECT AreaA.areaid AS AreaA_areaid, AreaA.parentarea AS AreaA_parentarea,
> bearerid, swa, swb, capacity, networktype, ccttype, spantype,
> workprot, nwbearer.datasrce AS nwbearer_datasrce, admin_status,
portcapacity,
> portcount, StationA.stationid AS StationA_stationid,
> StationA.tmolnos AS StationA_tmolnos, AreaB.areaid AS AreaB_areaid,
> AreaB.parentarea AS AreaB_parentarea, StationB.stationid AS
> StationB_stationid,
> StationB.tmolnos AS StationB_tmolnos, SpeedTrid_key, speedpk, TribSpeed,
> TribPortAllowed ,
> count(bearerid ) as cctcount
> FROM ((((nwbearer INNER JOIN pystation StationB ON
> StationB.stationid = nwbearer.stationb) INNER JOIN pystation StationA ON
> StationA.stationid = nwbearer.stationa) INNER JOIN rfspeedtrib ON
> nwbearer.SpeedTrib_key = rfspeedtrib.SpeedTrid_key) INNER JOIN area AreaB
ON
> AreaB.areaid = StationB.areaid) INNER JOIN area AreaA ON
> StationA.areaid = AreaA.areaid
> WHERE ( AreaA.parentarea LIKE '%{s_AreaA_parentarea}%'
> or Areab.parentarea LIKE '%{s_AreaA_parentarea}%' )
> AND networktype LIKE '%{s_networktype}%'
> AND ccttype LIKE '%{s_ccttype}%'
> AND speedpk LIKE '%{s_speedpk}%'
> group by AreaA_parentarea, Areab_parentarea,
> speedpk, TribSpeed, TribPortAllowed , networktype, ccttype
>
>
>
> But it still does not work. Help pls
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.