如何防止Crystal Web服务器在每个页面上重新获取数据 [英] How to prevent Crystal webserver refetching data on each page

查看:40
本文介绍了如何防止Crystal Web服务器在每个页面上重新获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在通过其Web服务器使用Crystal 11.当我们运行报表时,它会执行Sql查询,并在Crystal Web reportviewer中显示报表的第一页.

We're using Crystal 11 through their webserver. When we run a report, it does the Sql query and displays the first page of the report in the Crystal web reportviewer.

点击下一页按钮时,它将重新运行Sql查询并显示下一页.

When you hit the next page button, it reruns the Sql query and displays the next page.

我们如何停止对数据的重新查询?

How do we get the requerying of the data to stop?

我们还有多个人同时运行同一份报告(毕竟这是一台Web服务器),我们不想在同一份报告的不同实例之间缓存数据,我们只想缓存数据在报告的每个单个实例中.

We also have multiple people running the same reports at the same time (it is a web server after all), and we don't want to cache data between different instances of the same report, we only want to cache the data in each single instance of the report.

推荐答案

进行分页的原因不仅是表示方面的问题.分页最重要的优势是延迟加载数据-因此,理论上,根据给定的过滤器,仅加载需要的内容.

The reason to have pagination is not only a presentation concern. With pagination the single most important advantage is lazy loading of data - so that in theory, depending on given filters, you load only what you need.

试想一下,如果您的数据库中有数百万条记录,并加载了所有记录.首先,它会变得很慢,其次,您会获取很多您真正不需要的东西.如今,所有网络模型都基于延迟加载而不是批量加载.考虑一下Google App Engine:在给定的交易中,您无法从Google数据存储中检索到1000条以上的记录-而且您知道,如果仅尝试显示它们,浏览器就会死掉.

Just imagine if you have millions of records in your db and you load all of them. First of all is gonna be a hell of a lot slower, second you're fetching a lot of stuff you don't really need. All the web models nowadays are based on lazy loading rather than bulk loading. Think about Google App Engine: you can't retrieve more than 1000 records in a given transaction from the Google Datastore - and you know that if you'll only try and display them your browser will die.

我将回答一个问题-您是否遇到任何性能问题?

如果是这样,您可能会认为您会做得更好,但事实并非如此,因为您会减少服务器上的负载,但是每个查询都会消耗更多的资源.如果没有,我的建议是不要管它!:)

If so, you probably think you'll make it better but it's probably not the case, because you'll reduce the load on the server but each single query will be much more resource consuming. If not my advice is to leave it alone! :)

这篇关于如何防止Crystal Web服务器在每个页面上重新获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆