Reporting Service中 URL传递???

sinoghost 2005-05-27 11:16:44
在用URL访问报表文件时,要向报表传送一些特定的参数,这些参数怎样才可以用变量赋值啊??

已经定义好的变量
dim year as integer
year=2005

传送给报表
........../....&SalesYear=year

显示时,出现报表参数SalesYear 无效的信息.

哪位知道知道怎么样解决吗?多谢了
...全文
79 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lastpromiss 2005-05-30
  • 打赏
  • 举报
回复
支持中文参数吗?
sinoghost 2005-05-27
  • 打赏
  • 举报
回复
多谢了
lingbo_wx 2005-05-27
  • 打赏
  • 举报
回复
我是这样做的,不知道对你是否有帮助

我是这样做的
用asp页来传递参数
test.asp?oprid=222
在test.asp页里可以把oprid值读进一个变量
id=request("oprid")
然后在用
response.redirect("http://lingbo/reportserver?%2freportcase%2fReportcase&oprid="&id&"&rs:Command=Render")

注:我这里的文件夹是reportcase 报表名字也是reportcase
lingbo_wx 2005-05-27
  • 打赏
  • 举报
回复
报表里设置参数,url带入的参数必须和报表参数名一样
sinoghost 2005-05-27
  • 打赏
  • 举报
回复
各位
帮忙啊,着急
SQL注入的原理 什么SQL注入 将SQL代码插入到应用程序的输入参数,之后,SQL代码被传递到数据库执行。从而达到对应用程序的攻击目的。 注入原理 常见攻击方法 检测是否可以注入【检测注入点】 示例:http://192.168.0.1/temp.aspx?id=a or 1=1-- 如果上面语句可以执行说明可以实现注入,则可以 利用系统过程、系统表注入数据库 示例【给系统添加一个用户,黑客可以实现远程登录控制服务器】:http://192.168.0.1/temp.aspx?id=1;exec xp_cmdshell 'net user admin 123456 /add' 绕过程序的限制 示例:程序往往限制单引号的数据,但是黑客传入单引号的ASCII码 跨站点注入 在Web页面挂某些恶意的HTML、JavaScript代码 防范SQL注入 限制错误信息的输出,避免错误信息的输出使得黑客知道网站的技术实现采用什么数据库,采用什么平台 示例:在Web.config文件设置 限制访问数据库账号的权限 在开发应用系统的时候就应该限制,给程序最小访问数据库的权限 使用参数命令传递参数 不要使用拼接字符串的方式构造SQL语句而采用参数命令 使用存储过程 存储过程在数据库 只能执行存储过程固定的代码 限制输入长度 防止黑客输入超大字符串,导致服务器瘫痪 防止黑客输入较长的恶意脚本等 实现方法:文本框的MaxLength属性 URL重写技术 示例: http://testWeb/news.aspx?id=111 重写成:http://testWeb/10101111.html 传递参数尽量不用字符串 http://testWeb/news.aspx?id=111 and 1=1【黑色部分给了SQL注入的机会】 SQL优化 为什么要优化 开发是对性能考虑不多【技术差、项目工期紧等原因没有考虑性能问题】 系统运行,数据量扩大,访问量增多,蹩脚的SQL危害开始显露 低效SQL的危害 系统响应变慢,软件开发的8秒定律,当打开一个软件或网页超过8秒时间还没有显示,则响应太慢。 死锁,当不同用户都访问某些资源的时候SQL语句不当导致死锁 客户失去信心,软件失败 低效SQL低效在哪里?  性能低下的根源  硬件原因,数据库的配置不合理,数据库的数据文件和日志文件没有分磁盘存放,会极大影响IO性能  没有建立索引,或者SQL没有走索引。在千万级数据的表上建索引是很有必要的。  SQL过于复杂,过长的SQL语句满足程序需求但是影响性能。子查询嵌套过多对性能有影响,查询关联的表特别多也影响性能  频繁访问数据等等 SQL如何被SQLServer执行的 SQL执行原理  解释:首先解释SQL语句【语法是否正确】  解析:检验语句的出现的对象是否有效【进行一个解析,要检查对象所有权的权限】  优化:【检查SQL语句是否能够使用索引,SQL语句如何执行效率高,制定一个执行计划】  编译:  执行SQL语句:【把编译过的查询要求提交并进行处理】 如何优化SQL 完善开发的管理 完善代码审核、测试机制,软件开发是艺术! 检测SQL查询的效率 语法【对IO和Time对SQL执行进行统计】: SET STATISTICS IO ON SET STATISTICS TIME ON ------------SQL代码--------- SET STATISTICS IO OFF SET STATISTICS TIME OFF 注意:在检测之前要清理缓存,因为当我们执行SQL语句的时候查出的数据会在数据库进行缓存,重新查询会返回缓存的信息。 DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE 经验:使用子查询嵌套不要过多,尽量使用表连接查询代替子查询,因为表连接查询效率稍高一点。 SQL优化工具 使用报表服务 通过Reporting Service查找低效SQL 选择 性能 - 批处理执行统计信息和性能相关的几个报表服务: 性能 - 对象执行统计信息 性能 - 按平均CPU时间排在前面的查询 性能 - 按平均IO次数排在前面的查询 性能 - 按总CPU时间排在前面的查询 性能 - 按IO总次数排在前面的查询 操作示范: 1. 数据引擎上点击右键—报表—标准报表—关心的
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.startup; import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.catalina.Globals; import org.apache.catalina.security.SecurityClassLoad; import org.apache.catalina.startup.ClassLoaderFactory.Repository; import org.apache.catalina.startup.ClassLoaderFactory.RepositoryType; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; /** * Bootstrap loader for Catalina. This application constructs a class loader * for use in loading the Catalina internal classes (by accumulating all of the * JAR files found in the "server" directory under "catalina.home"), and * starts the regular execution of the container. The purpose of this * roundabout approach is to keep the Catalina internal classes (and any * other classes they depend on, such as an XML parser) out of the system * class path and therefore not visible to application level classes. * * @author Craig R. McClanahan * @author Remy Maucherat */ public final class Bootstrap { private static final Log log = LogFactory.getLog(Bootstrap.class); /** * Daemon object used by main. */ private static Bootstrap daemon = null; private static final File catalinaBaseFile; private static final File catalinaHomeFile; private static final Pattern PATH_PATTERN = Pattern.compile("(\".*?\")|(([^,])*)"); static { // Will always be non-null //System.getProperty("user.dir"),获取当前目录 //由于是在$CATALINA_HOME\bin下运行的Bootstrap,所以userDir为$CATALINA_HOME\bin String userDir = System.getProperty("user.dir"); // Home first //Globals是存放全局常量的类 //Globals.CATALINA_HOME_PROP = "catalina.home" //catalina.home在运行Bootstrap时已设置(Tomcat的根目录) String home = System.getProperty(Globals.CATALINA_HOME_PROP); File homeFile = null; //获取Tomcat的绝对路径 if (home != null) { File f = new File(home); try { homeFile = f.getCanonicalFile(); } catch (IOException ioe) { homeFile = f.getAbsoluteFile(); } } if (homeFile == null) { // First fall-back. See if current directory is a bin directory // in a normal Tomcat install File bootstrapJar = new File(userDir, "bootstrap.jar"); if (bootstrapJar.exists()) { File f = new File(userDir, ".."); try { homeFile = f.getCanonicalFile(); } catch (IOException ioe) { homeFile = f.getAbsoluteFile(); } } } if (homeFile == null) { // Second fall-back. Use current directory File f = new File(userDir); try { homeFile = f.getCanonicalFile(); } catch (IOException ioe) { homeFile = f.getAbsoluteFile(); } } //设置catalinaHomeFile catalinaHomeFile = homeFile; System.setProperty( Globals.CATALINA_HOME_PROP, catalinaHomeFile.getPath()); // Then base String base = System.getProperty(Globals.CATALINA_BASE_PROP); //设置catalinaBaseFile if (base == null) { catalinaBaseFile = catalinaHomeFile; } else { File baseFile = new File(base); try { baseFile = baseFile.getCanonicalFile(); } catch (IOException ioe) { baseFile = baseFile.getAbsoluteFile(); } catalinaBaseFile = baseFile; } System.setProperty( Globals.CATALINA_BASE_PROP, catalinaBaseFile.getPath()); } // -------------------------------------------------------------- Variables /** * Daemon reference. */ private Object catalinaDaemon = null; protected ClassLoader commonLoader = null; protected ClassLoader catalinaLoader = null; protected ClassLoader sharedLoader = null; // -------------------------------------------------------- Private Methods private void initClassLoaders() { try { //创建commonLoader commonLoader = createClassLoader("common", null); if( commonLoader == null ) { // no config file, default to this loader - we might be in a 'single' env. commonLoader=this.getClass().getClassLoader(); } //创建catalinaLoader、sharedLoader catalinaLoader = createClassLoader("server", commonLoader); sharedLoader = createClassLoader("shared", commonLoader); } catch (Throwable t) { handleThrowable(t); log.error("Class loader creation threw exception", t); System.exit(1); } } private ClassLoader createClassLoader(String name, ClassLoader parent) throws Exception { //CatalinaProperties解析$CATALINA_HOME\conf\catalina.properties, //并将catalina.properties内的属性存为系统属性 //catalina.properties内common.loader="${catalina.base}/lib", //"${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar" //读取common.loader String value = CatalinaProperties.getProperty(name + ".loader"); if ((value == null) || (value.equals(""))) return parent; //将${catalina.base},${catalina.home}替换为Tomcat的绝对路径 value = replace(value); List repositories = new ArrayList<>(); String[] repositoryPaths = getPaths(value); for (String repository : repositoryPaths) { // Check for a JAR URL repository try { @SuppressWarnings("unused") URL url = new URL(repository); repositories.add( new Repository(repository, RepositoryType.URL)); continue; } catch (MalformedURLException e) { // Ignore } // Local repository if (repository.endsWith("*.jar")) { repository = repository.substring (0, repository.length() - "*.jar".length()); repositories.add( new Repository(repository, RepositoryType.GLOB)); } else if (repository.endsWith(".jar")) { repositories.add( new Repository(repository, RepositoryType.JAR)); } else { repositories.add( new Repository(repository, RepositoryType.DIR)); } } //ClassLoaderFactory依据repositories的内容创建ClassLoader return ClassLoaderFactory.createClassLoader(repositories, parent); } /** * System property replacement in the given string. * * @param str The original string * @return the modified string */ protected String replace(String str) { // Implementation is copied from ClassLoaderLogManager.replace(), // but added special processing for catalina.home and catalina.base. String result = str; int pos_start = str.indexOf("${"); if (pos_start >= 0) { StringBuilder builder = new StringBuilder(); int pos_end = -1; while (pos_start >= 0) { builder.append(str, pos_end + 1, pos_start); pos_end = str.indexOf('}', pos_start + 2); if (pos_end < 0) { pos_end = pos_start - 1; break; } String propName = str.substring(pos_start + 2, pos_end); String replacement; if (propName.length() == 0) { replacement = null; } else if (Globals.CATALINA_HOME_PROP.equals(propName)) { replacement = getCatalinaHome(); } else if (Globals.CATALINA_BASE_PROP.equals(propName)) { replacement = getCatalinaBase(); } else { replacement = System.getProperty(propName); } if (replacement != null) { builder.append(replacement); } else { builder.append(str, pos_start, pos_end + 1); } pos_start = str.indexOf("${", pos_end + 1); } builder.append(str, pos_end + 1, str.length()); result = builder.toString(); } return result; } /** * Initialize daemon. */ public void init() throws Exception { //创建commonLoader、catalinaLoader、sharedLoader initClassLoaders(); //为当前线程设置ClassLoader Thread.currentThread().setContextClassLoader(catalinaLoader); //设置SecurityClassLoad。具体作用还不清楚。。。 SecurityClassLoad.securityClassLoad(catalinaLoader); // Load our startup class and call its process() method if (log.isDebugEnabled()) log.debug("Loading startup class"); //通过反射实例化Catalina Class startupClass = catalinaLoader.loadClass ("org.apache.catalina.startup.Catalina"); Object startupInstance = startupClass.newInstance(); // Set the shared extensions class loader if (log.isDebugEnabled()) log.debug("Setting startup class properties"); String methodName = "setParentClassLoader"; Class paramTypes[] = new Class[1]; paramTypes[0] = Class.forName("java.lang.ClassLoader"); Object paramValues[] = new Object[1]; paramValues[0] = sharedLoader; //通过反射设置Catalina的parentClassLoader Method method = startupInstance.getClass().getMethod(methodName, paramTypes); method.invoke(startupInstance, paramValues); //将实例化的Catalina赋值给catalinaDaemon catalinaDaemon = startupInstance; } /** * Load daemon. */ private void load(String[] arguments) throws Exception { // Call the load() method //调用catalinaDaemon的load方法,并传递参数"start" String methodName = "load"; Object param[]; Class paramTypes[]; if (arguments==null || arguments.length==0) { paramTypes = null; param = null; } else { paramTypes = new Class[1]; paramTypes[0] = arguments.getClass(); param = new Object[1]; param[0] = arguments; } Method method = catalinaDaemon.getClass().getMethod(methodName, paramTypes); if (log.isDebugEnabled()) log.debug("Calling startup class " + method); method.invoke(catalinaDaemon, param); } /** * getServer() for configtest */ private Object getServer() throws Exception { String methodName = "getServer"; Method method = catalinaDaemon.getClass().getMethod(methodName); return method.invoke(catalinaDaemon); } // ----------------------------------------------------------- Main Program /** * Load the Catalina daemon. */ public void init(String[] arguments) throws Exception { init(); load(arguments); } /** * Start the Catalina daemon. */ public void start() throws Exception { if( catalinaDaemon==null ) init(); //调用catalinaDaemon的start方法 Method method = catalinaDaemon.getClass().getMethod("start", (Class [] )null); method.invoke(catalinaDaemon, (Object [])null); } /** * Stop the Catalina Daemon. */ public void stop() throws Exception { Method method = catalinaDaemon.getClass().getMethod("stop", (Class [] ) null); method.invoke(catalinaDaemon, (Object [] ) null); } /** * Stop the standalone server. */ public void stopServer() throws Exception { Method method = catalinaDaemon.getClass().getMethod("stopServer", (Class []) null); method.invoke(catalinaDaemon, (Object []) null); } /** * Stop the standalone server. */ public void stopServer(String[] arguments) throws Exception { Object param[]; Class paramTypes[]; if (arguments==null || arguments.length==0) { paramTypes = null; param = null; } else { paramTypes = new Class[1]; paramTypes[0] = arguments.getClass(); param = new Object[1]; param[0] = arguments; } Method method = catalinaDaemon.getClass().getMethod("stopServer", paramTypes); method.invoke(catalinaDaemon, param); } /** * Set flag. */ public void setAwait(boolean await) throws Exception { //通过反射,设置catalinaDaemon的await Class paramTypes[] = new Class[1]; paramTypes[0] = Boolean.TYPE; Object paramValues[] = new Object[1]; paramValues[0] = Boolean.valueOf(await); Method method = catalinaDaemon.getClass().getMethod("setAwait", paramTypes); method.invoke(catalinaDaemon, paramValues); } public boolean getAwait() throws Exception { Class paramTypes[] = new Class[0]; Object paramValues[] = new Object[0]; Method method = catalinaDaemon.getClass().getMethod("getAwait", paramTypes); Boolean b=(Boolean)method.invoke(catalinaDaemon, paramValues); return b.booleanValue(); } /** * Destroy the Catalina Daemon. */ public void destroy() { // FIXME } /** * Main method and entry point when starting Tomcat via the provided * scripts. * * @param args Command line arguments to be processed */ public static void main(String args[]) { if (daemon == null) { // Don't set daemon until init() has completed //***2.1*** Bootstrap bootstrap = new Bootstrap(); try { //***2.2*** bootstrap.init(); } catch (Throwable t) { handleThrowable(t); t.printStackTrace(); return; } //***2.3*** daemon = bootstrap; } else { // When running as a service the call to stop will be on a new // thread so make sure the correct class loader is used to prevent // a range of class not found exceptions. Thread.currentThread().setContextClassLoader(daemon.catalinaLoader); } //***2.4*** try { String command = "start"; if (args.length > 0) { command = args[args.length - 1]; } if (command.equals("startd")) { args[args.length - 1] = "start"; daemon.load(args); daemon.start(); } else if (command.equals("stopd")) { args[args.length - 1] = "stop"; daemon.stop(); } else if (command.equals("start")) { //***2.5*** daemon.setAwait(true); //***2.6*** daemon.load(args); //***2.7*** daemon.start(); } else if (command.equals("stop")) { daemon.stopServer(args); } else if (command.equals("configtest")) { daemon.load(args); if (null==daemon.getServer()) { System.exit(1); } System.exit(0); } else { log.warn("Bootstrap: command \"" + command + "\" does not exist."); } } catch (Throwable t) { // Unwrap the Exception for clearer error reporting if (t instanceof InvocationTargetException && t.getCause() != null) { t = t.getCause(); } handleThrowable(t); t.printStackTrace(); System.exit(1); } } /** * Obtain the name of configured home (binary) directory. Note that home and * base may be the same (and are by default). */ public static String getCatalinaHome() { return catalinaHomeFile.getPath(); } /** * Obtain the name of the configured base (instance) directory. Note that * home and base may be the same (and are by default). If this is not set * the value returned by {@link #getCatalinaHome()} will be used. */ public static String getCatalinaBase() { return catalinaBaseFile.getPath(); } /** * Obtain the configured home (binary) directory. Note that home and * base may be the same (and are by default). */ public static File getCatalinaHomeFile() { return catalinaHomeFile; } /** * Obtain the configured base (instance) directory. Note that * home and base may be the same (and are by default). If this is not set * the value returned by {@link #getCatalinaHomeFile()} will be used. */ public static File getCatalinaBaseFile() { return catalinaBaseFile; } // Copied from ExceptionUtils since that class is not visible during start private static void handleThrowable(Throwable t) { if (t instanceof ThreadDeath) { throw (ThreadDeath) t; } if (t instanceof VirtualMachineError) { throw (VirtualMachineError) t; } // All other instances of Throwable will be silently swallowed } // Protected for unit testing protected static String[] getPaths(String value) { Listing> result = new ArrayList<>(); Matcher matcher = PATH_PATTERN.matcher(value); while (matcher.find()) { String path = value.substring(matcher.start(), matcher.end()); path = path.trim(); if (path.startsWith("\"") && path.length() > 1) { path = path.substring(1, path.length() - 1); path = path.trim(); } if (path.length() == 0) { continue; } result.add(path); } return result.toArray(new String[result.size()]); } }

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧