Passing parameter to swf being loaded
When loading an SWF using loadMovieNum() how shall I pass a
parameter to the
swf being loaded?
aa,
> appending variables using syntax
filename.swf?var1=something
> resulted in an error
> Error opening URL
"file:///E|/filename.swf?var1=something"
Charles said it wasn't tested, and I said it was something
you could
try, but like Charles, I wasn't certain that was a valid
approach.
> Obviously it forces it to look for a file named
> filename.swf?var1=something
That depends on how you're loading it. When the file is
loaded from a
server, you won't have that problem. I just tested the
suggestion Charles
and I made, and it turns out our hunces were correct -- so
you're in luck.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."
Similar Messages
-
Pass Parameter to Module Loaded with ModuleManager
Is it possible to pass a parameter to a module loaded with ModuleManager?
80sRelic,
First, to answer a lingering question from your last post, the reason simIndex was 3 for each module (as opposed to 1,2,3) has to do with timing. When you ran getDataFromParent() within the module you probably did so after an event like the creationComplete event. The for loop (with simIndex++) executed almost instantly while the asynchronous events for each module kicked in a few ms later, so '3' across the board.
Also, as far as the IModuleInfo::factory.create() method goes, yes you can pass a slew of parameters in here, but this is NOT the way to pass data to the module. I don't know what this parameter is all about, I thought it might pass variables to the module constructor (it does not), the documentation says something about 'let building factories change what they create,' but I never figured it out. Sorry. All I know is that whatever this is, it is not the way.
BTW, the general topic we're dealing with is 'passing data' between module and application and more info can be found here and in the flex 3 cookbook.
But, I'm guessing you already know this. (Just in case!!! )
Of all the ways to pass data, gettingDataFromTheParent() is probably the worst method, or so they say. In general, passing data between module and application couples the two objects together and so they are no longer are they black boxes to each other. And I'm guessing the reason gettingDataFromParent() is the least preferred method probably has to do with change, where changeOverTimeOfApp > changeOverTimeOfModule.
I wrote a small app, which might help demonstrate a nice way for you to pass data in your project. Please note that the app, as it stands doesn't make much sense. Modules should only be used when there's a really good reason to do so, for instance if the module is prohibitively large and only a fraction of the users will actually ever need to employ the module. In my particular example, using a custom component would be simpler and make much much more sense.
Well, here it is (with .fxp appended at the bottom). Hope this helps,
- e
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" >
<fx:Script>
<![CDATA[
import modules.ColoredRectangle;
import mx.collections.ArrayCollection;
import mx.events.ModuleEvent;
import mx.modules.IModuleInfo;
import mx.modules.ModuleManager;
private var myModInfo:IModuleInfo;
private var myColor:uint;
private var colorCollection:ArrayCollection = new ArrayCollection(
[{colorName:"Red", hex:"0xFF0000"},
{colorName:"Orange", hex:"0xFFA500"},
{colorName:"Yellow", hex:"0xFFFF00"},
{colorName:"Green", hex:"0x008000"},
{colorName:"Blue", hex:"0x0000FF"},
{colorName:"Indigo", hex:"0x4B0082"},
{colorName:"Violet", hex:"0xEE82EE"}] );
protected function fetchModules():void {
myModInfo = ModuleManager.getModule("modules/ColoredRectangle.swf");
myModInfo.addEventListener(ModuleEvent.READY, moduleReadyHandler);
myModInfo.load();
private function moduleReadyHandler(event:ModuleEvent):void {
for each(var colorObj:Object in colorCollection) {
var myModuleInstance:ColoredRectangle = myModInfo.factory.create() as ColoredRectangle;
myModuleInstance.myColor = uint(colorObj.hex);
tileBox.addElement(myModuleInstance);
]]>
</fx:Script>
<s:HGroup verticalCenter="0" horizontalCenter="0"
width="750" height="400" gap="50">
<s:Border width="100%" height="400">
<s:layout>
<s:VerticalLayout />
</s:layout>
<s:Button id="seeModulesButton1" label="fetch modules!"
click="fetchModules()" width="100%"/>
<s:Scroller width="100%" height="100%">
<s:Group id="tileBox" height="100%" width="100%">
<s:layout>
<s:TileLayout columnAlign="justifyUsingGap" />
</s:layout>
</s:Group>
</s:Scroller>
</s:Border>
</s:HGroup>
</s:Application> -
.swf being able to load contents into it issue. Please help?
Hi there,
I have strange situation regarding flash that I can't figure out. I have a flash .swf file that is intended to load .flv video files into them at the local root level.
I have been able to do this on my own server, but the .swf and the .flv videos are now located on the media streaming server, and the .swf is able to show up on it's own when embedded onto my page (on MY server), but it's not being able to load the video files. I am perplexed because the videos are structured in the same EXACT way that it was being done on my server, but they will not load onto my .swf as they were doing when they were on my server.
For example, one of the videos is loaded by using this convention in my actionscript:
var file = "videos/Bob_Peebler.flv";
So, on my media hosting service, I've loaded the .swf file on the local root, and the videos are placed in the same exact directory structure as they were done on my server. In the example above, the "bob_peebler.flv" is located inside the videos folder, and the videos folder is on the same level as the .swf
In my flash file, I've thought that the var needs to point to the actual URL of the flash file, so I've then typed out the URL of the flash video, but I still can't seem to get it to work.
var file = "http://iongeo.fileburst.com/videos/Bob_Peebler.flv";
Here is where the .swf can be located to get a better sense of what I am trying to accomplish.
http://iongeo.fileburst.com/ChannelGuide_Features.swf
Please let me know if I can clarify on something better.
I would really appreciate any kind of assistance that could be provided.
Thank youHello
On my flash, I already have those parameters in place.
I don't think there would be any security issues however, since I have used a player .swf which loads from the media site and plays the videos without a problem.
http://www.iongeo.com/channelguide_test_dev/
click on the four images at the bottom of the screen to see how it works.
Now, I am pretty much doing the same thing, but this time embedding the other swf to load the videos. As I mentioned, I was able to do this when everything was on our server, but now there is an issue for some reason when I try to load the .flv into the .swf from the other media server. -
Passing data parameter between SWF files
Hello Xcelsius Gurus,
Is it possible to pass data parameter between SWF files?
If possible, how to achieve it?
Thank you.
JustineHi,
Thank you for the reference. Little bit confused, please let me clarify.
I do not understand how the receiver SWF receieved the data parameter and process.
For example, I have a parent dashboard and a child dashboard. In the parent dashboard, I have set up combo box to filter the data. And I want the data that I have selected in combo box to the child dashboard.
To do this, first I need to setup the flash variable at the parent dashboard to fetch the data I selected.
After this, how to link this data to the child dashboard?
Furthermore, after the child dashboard received the data parameter, I need this data to insert into the spreadsheet so I can filter the data. Is this possible?
Thanks.
Edited by: Justine Liu on Jan 19, 2010 3:11 PM -
Feature Request: Pass parameters to loaded SWF through Loader
I would like the option to add parameters (similar to
loaderInfo.parameters) when loading an SWF with Loader.load().
These parameters will then appear in loaderInfo.parameters in the
loaded SWF.
You might ask, why not just append them as a query string to
the source URL? The answer is: doing that means the loaded file has
a unique URL and this defeats browser caching. The SWF might
already be in cache, but it will be forced to re-download because
the url has some query variables appended. Instead, I should be
able to pass these invisibly to the loaded SWF.I don't think there is any way to get it in
loaderInfo.parameters.
I see, you want to get the variables available before the
child constructors complete. I don't like telling people how they
should practice their app design, but have you considered placing
the code instead in public methods and manually calling them after
loaderInfo.complete or loaderInfo.init? I believe that would be
expected design in this case. However, I agree that vars available
on load are nice.
You might be able to use loaderInfo.progress to find a point
at which the movie is sufficiently loaded to add properties to it
but the constructors have not fired, and in this way you might be
able to accomplish what you want. I doubt it will be the case -- it
wasn't possible in AS2. It's worth some investigation though.
HTH -
Problem passing parameter to crystal report subreport from *.aspx page
Background:
I am developing a .NET web application using Visual Studio 2005. The code behind is in VB.net. One of my asp.net pages calls a report, which is invoked when the user clicks a Print button. I have developed this report using the Crystal Reports software that is bundled with Visual Studio 2005. I am passing one parameter from the asp.net page (utilizing the VB.net code-behind on the Print button) to the Crystal report. The report consists of a main report and 5 subreports. Both the main report and the subreports use the same parameter. Both the main report and the subreports are bound to stored procedures, each of which require a parameter.
Problem:
For some reason, the parameter is not being passed from the asp.net page to the report. I am receiving the following error: "CrystalDecisions.CrystalReports.Engine.ParameterField.CurrentValueException: Missing Parameter Values." However, when I remove the subreports, the parameter gets passed, and the report is invoked with no problem.
I have read in other forums that there may be an issue with the Crystal Reports software that is causing this problem. I have downloaded and run the suggested hotfix, but the problem remains unresolved. I have tried changing the linking of my main report to the subreport, but that doesn't help either. It is possible that I am doing something wrong with the linking, as this is the first time I have developed a report with Crystal Reports. I need a workaround or definitive solution. Below is the aspx code used to call the report:
Imports System
Imports System.Collections.Specialized
Imports System.Collections.ObjectModel
Imports System.Collections
Imports System.Text
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Data
Imports System.Data.SqlClient.SqlDataAdapter
Imports System.Web.Configuration
Imports Crystaldecisions.crystalreports.engine
Imports Crystaldecisions.reportsource
Imports Crystaldecisions.shared
Partial Class OACIS_Award_or_Deny_BudgetSummary_PrintRpt
Inherits System.Web.UI.Page
Dim paramFields As ParameterFieldDefinitions
Dim paramField As ParameterFieldDefinition
Dim paramValue As ParameterValues
Dim paramDiscreteValue As New ParameterDiscreteValue
Public Shared idCase, nameRpt As String
Private PrintRpt As ReportDocument
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
idCase = Request.QueryString("id")
nameRpt = Request.QueryString("prtName")
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~/")
Dim settings As AppSettingsSection = DirectCast(config.GetSection("appSettings"), AppSettingsSection)
Dim file As String = settings.File
Dim dSource, iCatalog, userIs, passUser, appString As String
dSource = Nothing
iCatalog = Nothing
userIs = Nothing
passUser = Nothing
appString = config.ConnectionStrings.ConnectionStrings("OacisConn").ToString()
Dim AppArray() As String = Split(appString, ";")
Dim arrayLgth As Integer = AppArray.Length
Dim i As Integer
For i = 0 To arrayLgth - 1
Dim pairIs() As String = Split(AppArray(i), "=")
Dim firstItem As String = pairIs(0)
Dim secondItem As String = pairIs(1)
If firstItem = "Data Source" Then : dSource = secondItem : End If
If firstItem = "Initial Catalog" Then : iCatalog = secondItem : End If
If firstItem = "UID" Then : userIs = secondItem : End If
If firstItem = "PWD" Then : passUser = secondItem : End If
Next
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim crconnectioninfo As ConnectionInfo
Dim crDatabase As Database
Dim crtables As Tables
Dim crtable As Table
Dim crtablelogoninfo As TableLogOnInfo
Dim Fname As String
Dim Prtname As String
Dim FPath As String
Dim crSection As Section
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
FPath = Server.MapPath("") + "\"
Dim rptIs As String = nameRpt
crReportDocument = New ReportDocument
Prtname = FPath
Prtname = Prtname + rptIs
crReportDocument.Load(Prtname)
Fname = "C:\WINDOWS\TEMP\" & Session.SessionID.ToString & ".pdf"
crconnectioninfo = New ConnectionInfo
crconnectioninfo.ServerName = dSource
crconnectioninfo.DatabaseName = iCatalog
crconnectioninfo.UserID = userIs
crconnectioninfo.Password = passUser
crDatabase = crReportDocument.Database
crtables = crDatabase.Tables
For Each crtable In crtables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
Response.Write(ex)
Exit Sub
End Try
Next crtable
For Each crSection In crReportDocument.ReportDefinition.Sections
For Each crReportObject In crSection.ReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
crSubreportObject = CType(crReportObject, SubreportObject)
subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
For Each crtable In subRepDoc.Database.Tables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
End Try
Next
End If
Next
Next
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
Dim parIDCase As ParameterValues = New ParameterValues
Dim disIDCase As ParameterDiscreteValue = New ParameterDiscreteValue
disIDCase.Value = idCase
parIDCase.Add(disIDCase)
crReportDocument.DataDefinition.ParameterFields("@ID_CASE_NMBR").ApplyCurrentValues(parIDCase)
crReportDocument.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
Catch ex As Exception
lblMessage.Visible = True
lblMessage.Text = "Error Load
" & Convert.ToString(ex)
End Try
End Sub
End Class
Your help is greatly appreciated!Thanks for your help!
I've now gotten past the "missing parameter values" error, and the report renders fine in the report viewer. However, I've encounted another problem. The data in my main report displays correctly, but the data in my subreport does not display. Of course, when I view the report in the designer, both the main report and subreport display correctly. What am I doing wrong? Below is my vb.net code:
Try
idCase = Request.QueryString("id")
nameRpt = Request.QueryString("prtName")
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~/")
Dim settings As AppSettingsSection = DirectCast(config.GetSection("appSettings"), AppSettingsSection)
Dim file As String = settings.File
Dim dSource, iCatalog, userIs, passUser, appString As String
dSource = Nothing
iCatalog = Nothing
userIs = Nothing
passUser = Nothing
appString = config.ConnectionStrings.ConnectionStrings("OacisConn").ToString()
Dim AppArray() As String = Split(appString, ";")
Dim arrayLgth As Integer = AppArray.Length
Dim i As Integer
For i = 0 To arrayLgth - 1
Dim pairIs() As String = Split(AppArray(i), "=")
Dim firstItem As String = pairIs(0)
Dim secondItem As String = pairIs(1)
If firstItem = "Data Source" Then : dSource = secondItem : End If
If firstItem = "Initial Catalog" Then : iCatalog = secondItem : End If
If firstItem = "UID" Then : userIs = secondItem : End If
If firstItem = "PWD" Then : passUser = secondItem : End If
Next
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim crconnectioninfo As ConnectionInfo
Dim crDatabase As Database
Dim crtables As Tables
Dim crtable As Table
Dim crtablelogoninfo As TableLogOnInfo
Dim Fname As String
Dim Prtname As String
Dim FPath As String
Dim crSection As Section
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
FPath = Server.MapPath("") + "\"
Dim rptIs As String = nameRpt
crReportDocument = New ReportDocument
Prtname = FPath
Prtname = Prtname + rptIs
crReportDocument.Load(Prtname)
Fname = "C:\WINDOWS\TEMP\" & Session.SessionID.ToString & ".pdf"
crconnectioninfo = New ConnectionInfo
crconnectioninfo.ServerName = dSource
crconnectioninfo.DatabaseName = iCatalog
crconnectioninfo.UserID = userIs
crconnectioninfo.Password = passUser
crDatabase = crReportDocument.Database
crtables = crDatabase.Tables
For Each crtable In crtables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
Response.Write(ex)
Exit Sub
End Try
Next crtable
For Each crSection In crReportDocument.ReportDefinition.Sections
For Each crReportObject In crSection.ReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
crSubreportObject = CType(crReportObject, SubreportObject)
subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
For Each crtable In subRepDoc.Database.Tables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
End Try
Next
End If
Next
Next
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.SetParameterValue("@ID_CASE_NMBR", idCase)
crReportDocument.SetParameterValue("@ID_CASE_NMBR", idCase, "MemberName")
crReportDocument.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
Catch ex As Exception
lblMessage.Visible = True
lblMessage.Text = "Error Load<br>" & Convert.ToString(ex)
End Try
Edited by: LaShandra Knox on Sep 17, 2008 7:59 PM -
Jsf passing parameter between jsp's
Hi
I have my main.jsp and another screen which i call object.jsp
the object.jsp can present an object in multiple ways : add, edit, view
i have 3 buttons in my main.jsp add, edit, view. I want to pass a parameter from main.jsp to object.jsp such that object.jsp will know in what state its being loaded... how do i do this?
Thanks..session?
as the article says :
To avoid these problems, developers might use session-scoped variables instead. This fixes both of those problems, but adds new ones:
A single user cannot have two windows open simultaneously; session-scoped variables are global to the user. So, for instance, a user could not work with two different search results simultaneously.
Back button support is highly limited, since navigating back can't magically restore the session to its old state. -
Pass parameter to pl/sql block
Hi,
I am getting following error when trying to create staging table from shell script by passing parameter.
SQL*Loader-941: Error during describe of table T1_1DAY_STG
ORA-04043: object T1_1DAY_STG does not existThis is PL/SQL block being called inside shell script
begin
execute immediate 'create table t1_&1._stg as select * from t1_rpt_tmt';
end Shell Script Call
load_data_to_oracle()
for i in 1DAY 7DAY 15DAY
do
${ORACLE_HOME}/bin/sqlplus ${ORACLE_USER}/${ORACLE_PASSWD}@${ORACLE_SID} << EOF > ${TMP_LOG_FILE} 2>&1
set serveroutput on
@${CREATE_STAGE_SQL} "$i"
COMMIT;
QUIT;
EOF
########Main#######
load_data_to_oracleThanks
SandyIt is probably a permission issue. Are you the owner of the table you are trying to select from in your PL/SQL block? if not, do you have select permission granted specifically?
Here is my test:
test > create table T_ABC (a number, b number);
Table created.
test > @t_abc Hello
test > begin
2
3 execute immediate 'create table t1_&1._stg as select * from t_abc';
4
5 end;
6 /
old 3: execute immediate 'create table t1_&1._stg as select * from t_abc';
new 3: execute immediate 'create table t1_Hello_stg as select * from t_abc';
PL/SQL procedure successfully completed.
test > desc t1_Hello_stg
Name
A
B
test > desc T_ABC
Name
A
B
test > -
How to pass parameter to pl/sql block
Hi,
I am getting following error when trying to create staging table from shell script by passing parameter.
SQL*Loader-941: Error during describe of table T1_1DAY_STG
ORA-04043: object T1_1DAY_STG does not existThis is PL/SQL block being called inside shell script
begin
execute immediate 'create table t1_&1._stg as select * from t1_rpt_tmt';
endShell Script Call
load_data_to_oracle()
for i in 1DAY 7DAY 15DAY
do
${ORACLE_HOME}/bin/sqlplus ${ORACLE_USER}/${ORACLE_PASSWD}@${ORACLE_SID} << EOF > ${TMP_LOG_FILE} 2>&1
set serveroutput on
@${CREATE_STAGE_SQL} "$i"
COMMIT;
QUIT;
EOF
########Main#######
load_data_to_oraclethanks
sandyi dont understand why you want run it from shell script. you can write procedure like this :
SQL>
SQL> CREATE OR REPLACE PROCEDURE mytestProc(p_in VARCHAR2) AS
2 begin
3 FOR i IN (select REGEXP_SUBSTR(p_in,'[^,]+',1,ROWNUM) tblName
4 from dual
5 CONNECT BY INSTR(p_in, ',', 1, level - 1) > 0)
6 LOOP
7 execute immediate 'create table t1_'||i.tblname||'_stg as select * from myt2';
8 END LOOP;
9 end;
10 /
Procedure createdand run it
SQL> exec mytestProc('1day,7day,15day');
PL/SQL procedure successfully completed
SQL> select * from t1_15day_stg
2 union all
3 select * from t1_1day_stg
4 union all
5 select * from t1_7day_stg;
T N
SQL>
SQL> drop table t1_15day_stg;
Table dropped
SQL> drop table t1_1day_stg;
Table dropped
SQL> drop table t1_7day_stg;
Table dropped
SQL> purge table t1_15day_stg;
Done
SQL> purge table t1_1day_stg;
Done
SQL> purge table t1_7day_stg;
Done
SQL> -
Post Author: usaitconsultant
CA Forum: JAVA
Would you know if there's a way to mimic Deski
document from BOXI server(CMS) to local machine, pass parameter, execute and
save in a mutiple report format then store in a local drive or network
drive? Most examples and tutorials in BO XI R2 I've seen are scheduling while drilling report is for web intelligence only and not desktop intelligence. Please let me know your ideas. I would really appreciate your help. Thanks.Post Author: usaitconsultant
CA Forum: JAVA
Hi Ted,
Thanks for the reply.The file is not available in the server. Though, I checked CMS and I found an instance in history tab and the status is failed with error below.
Error Message:
A variable prevented the data provider Query 1 with BANRRD30 from being refreshed. (DMA0008).When I checked my codes, I found out that the object Im using is for web intelligence data provider. However, I cannot find any documentation and example for passing parameter values in desktop intelligence data provider. Any idea on this? You think this is not suported by Report Engine SDK?Thanks. -
<%@ page import="java.net.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Vector mail = new Vector();
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch (Exception E) {
out.println("Unable to load driver.");
E.printStackTrace();
try{
Connection C = DriverManager.getConnection("jdbc:mysql://localhost/attendance","root","");
%>
<div align="center"><font size="+6">Student BarList</font><br>
In this page will display out the student that attendance NOT MORE THAN 70%. The Student Below is NOT ALLOW to take exam for the relevant subject.
The student whoever not satisfy with the bar can negotiate with the lecturer of the relevant subject.<p/>
The student below will be bar from the relevent subject:
<%Statement S = C.createStatement();
ResultSet rs = S.executeQuery("SELECT * FROM bar");
ResultSetMetaData rsStruc = rs.getMetaData();
out.println("<table bgcolor=red cellpadding=10 cellspacing=1 size=70>");
out.println("<tr bgcolor=red>");
int colCount = rsStruc.getColumnCount();
String colName = "";
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
out.println("<td><B><font color=white>" + colName + "</font></b></td>\n");
out.println("</tr>");
while (rs.next()) {
String email=rs.getString("email");
mail.addElement(email);
out.println("<tr bgcolor=ffffff>");
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
String fld = rs.getString(colName);
out.println("<td>" + fld + "</td>");
out.println("</tr>");
out.println("</table>");
rs.close();
C.close();}
catch (Exception E) {
out.println("SQLException: " + E.getMessage());
for(int i=0; i< mail.size(); i++){
String add= mail.elementAt(i)+",";
out.println(add);
%>
<form action="simplemail.jsp" method="post">
<input type="text" name="address" value="<%=add%>">
<input type="submit" name="send" value="Send Mail">
</body>
</html>
what problem with my page i want to read the vector data then set it inside the variable (e.g [email protected],[email protected]) then put it into the textbox and passing parameter to next page.. how i gotta solve this problem?i have to use the hidden input html to send the vector to the next page but found out the problem "Type mismatch: cannot convert from String to Vector"
<%@ page import="java.net.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Vector mail = new Vector();
try{
Class.forName("com.mysql.jdbc.Driver");
catch (Exception E) {
out.println("Unable to load driver.");
E.printStackTrace();
try{
Connection C = DriverManager.getConnection("jdbc:mysql://localhost/attendance","root","");
%>
<div align="center"><font size="+6">Student BarList</font><br>
In this page will display out the student that attendance NOT MORE THAN 70%. The Student Below is NOT ALLOW to take exam for the relevant subject.
The student whoever not satisfy with the bar can negotiate with the lecturer of the relevant subject.<p/>
The student below will be bar from the relevent subject:<br/>
<%
Statement S = C.createStatement();
ResultSet rs = S.executeQuery("SELECT * FROM bar");
ResultSetMetaData rsStruc = rs.getMetaData();
out.println("<table bgcolor=red cellpadding=10 cellspacing=1 size=70>");
out.println("<tr bgcolor=red>");
int colCount = rsStruc.getColumnCount();
String colName = "";
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
out.println("<td><B><font color=white>" + colName + "</font></b></td>\n");
out.println("</tr>");
while (rs.next()) {
String email=rs.getString("email");
mail.addElement(email);
out.println("<tr bgcolor='ffffff'>");
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
String fld = rs.getString(colName);
out.println("<td>" + fld + "</td>");
out.println("</tr>");
out.println("</table>");
rs.close();
C.close();}
catch (Exception E) {
out.println("SQLException: " + E.getMessage());
//String add = "";
//for(int i=0; i< mail.size(); i++){
//add = mail.elementAt(i)+",";
//out.println(add);
%>
<form action="simplemail.jsp" method="post">
<input type="hidden" name="address" value="<%=mail%>">
<input type="submit" name="send" value="Send Mail">
</body>
</html>the vector should be pass to this page:
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
<%
Vector to2= new Vector();
to2=request.getParameter("address");
//String subject=request.getParameter("subject");
//String message2=request.getParameter("message");
for(int i=0; i< to2.size(); i++)
String add = (String)to2.elementAt(i);
System.out.println(add);
Properties props = new Properties();
props.put("localhost:25","localhost:25");
Session s = Session.getInstance(props,null);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("albert");
message.setFrom(from);
InternetAddress to = new InternetAddress(add);
message.addRecipient(Message.RecipientType.TO, to);
//message.setSubject(subject);
//message.setText(message2);
message.setSubject("Bar exam acknowledgement");
message.setText("You been bar from the exam, please check on the student attendance online for more information");
Transport.send(message);
%>
<html>
<p align="center">A Message has been sent.<br>Check your inbox.</p>
<p align="center"><a href="mail.html">Click here to send another!</a><br>
</p>
</html>please help me!!! i stuck in this oledi -
External .swf not loading on HTML pages
Good morning,
I'm having trouble and I was hoping someone could shed some light on what I'm doing wrong. I have a main .swf file from which external .swf files are being loaded through the use of buttons.
When I preview the animation, everything works just fine. The problem occurs when I put the animation on the website where it needs to be. The main animation appears like it's supposed to, but the buttons are not successful in loading the external .swf files. I've made sure that all .swf files are on the server but still nothing. Could anyone help? I'm not sure what the problem is.
Here's the AS:
stop();
var presentationLoader:Loader = new Loader();
addChild(presentationLoader);
//Navigation
presentation1.addEventListener(MouseEvent.CLICK, buttonClick);
presentation2.addEventListener(MouseEvent.CLICK, buttonClick);
presentation3.addEventListener(MouseEvent.CLICK, buttonClick);
presentation4.addEventListener(MouseEvent.CLICK, buttonClick);
presentation5.addEventListener(MouseEvent.CLICK, buttonClick);
presentation6.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void
presentationLoader.load(new URLRequest(event.target.name + ".swf"));
function homeClick(event:MouseEvent):void
presentationLoader.unload();
Thank you,
- CmarcouxFor anyone having a similar problem in the future, the solution is in bold:
stop();
var presentationLoader:Loader = new Loader();
addChild(presentationLoader);
//Navigation
presentation1.addEventListener(MouseEvent.CLICK, buttonClick);
presentation2.addEventListener(MouseEvent.CLICK, buttonClick);
presentation3.addEventListener(MouseEvent.CLICK, buttonClick);
presentation4.addEventListener(MouseEvent.CLICK, buttonClick);
presentation5.addEventListener(MouseEvent.CLICK, buttonClick);
presentation6.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void
presentationLoader.load(new URLRequest("../../media/flash/" + event.target.name + ".swf"));
function homeClick(event:MouseEvent):void
presentationLoader.unload();
For the animation to work on a website, the file path was needed. -
From scorecard Pass parameter to be used as Measure in query of analytic grid report in PPS
Any idea of how we can pass this parameter while connecting scorecard and report
any use of MDX in connection formula ?
Parameter needs to be assigned on click of scorecard cellHi,
That API has restrictions on its usage. Please see http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#CHDICGDA
The lines to be referred to are Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.Regards,
PS: Your report must be on Page 98 , so it is able to reference the item P98_NAV_IMAGE. List being a Shared Component it may not be able reference that Item.
Edited by: Prabodh on May 28, 2012 3:16 PM -
How can i pass parameter from a JSP form (depends on what user chooses from a select box to a Servlet.
I need to call multiple query based on what parameter choosen and display the result in table view.
Example :
1. User select choice1 from JSP form -> Servlet : call query Select * from Table1 where cond = choice1;
2. User select choice2 from JSP form -> Servlet : call query Select * from Table1 where cond = choice2;
Any sample code?
Thanks for any help.Thanks melondck.
I have this Servlet which i want it to run queries and display results in table format. I know there's something wrong with the code. But i am new to Servlet/Java. Thanks for anyone who point me the mistakes. Thanks.
<code>
package mypackage;
import java.sql.*;
import javax.servlet.http.*;
import java.io.*;
import javax.servlet.*;
public class DisplayServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse rsp)
throws ServletException, IOException {
rsp.setContentType("text/html");
String url="jdbc:mysql://localhost/smdb";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String query;
ServletOutputStream out = rsp.getOutputStream();
PrintWriter out1 = rsp.getWriter();
String answer = req.getParameter("answer");
out1.println("<html>");
out1.println("<head><title> Inventory: </title></head>");
out1.println("<body>");
if (answer == null) {
StringBuffer action = HttpUtils.getRequestURL(req);
out1.println("<form action=\"" + action + "\" method=\"POST\">\n");
out1.println("<p><b>Please select:</b></p>");
out1.println("<p><input type=\"radio\" name=\"answer\" " +
"value=\"A\" /> Display All <br />");
out1.println(" <input type=\"radio\" name=\"answer\" " +
"value=\"B\" /> Device <br />");
out1.println(" <input type=\"radio\" name=\"answer\" " +
"value=\"C\" /> Manufacturer <br />");
out1.println(" <input type=\"radio\" name=\"answer\" " +
"value=\"D\" /> Location <br />");
out1.println(" <input type=\"submit\" value=\"Submit\" /></p>");
out1.println("</form>");
} else {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection (url, "user", "mypass");
stmt = con.createStatement();
if (answer.equals("A")) {
query = "SELECT Device, LocFloor FROM Inventory";
esleif (answer.equals("B)) {
query = "SELECT Device, LocFloor FROM Inventory where ....";
ResultSet result = stmt.executeQuery(query);
//Display the result set in a HTML table
out.println("<HTML><HEAD><TITLE>List</TITLE></HEAD>");
out.println("<BODY>");
out.println("<FORM NAME='form' ");
out.println("METHOD='GET'><TABLE BORDER='1' CELLSPACING='2' CELLPADDING='2'>");
out.println("<TR><TH></TH><TH>Device Type</TH><TH>Floor</TH></TR>");
while(result.next()) {
String type = result.getString("Device");
String flr = result.getString("LocFloor");
out.println("<TD>" + type + "</TD>");
out.println("<TD>" + flr + "</TD>");
catch(ClassNotFoundException e) {
out.println("Could not load database driver: " + e.getMessage());
catch(SQLException e) {
out.println("SQLException caught: " + e.getMessage());
finally {
//close the database connection.
try {
if (con != null) con.close();
catch (SQLException e) {}
out.println("</body></html>");
</code> -
Syntax to pass parameter value to jsp using href in out.println
Hi,
I have the URL in the form as mentioned below:
<a href="b2c/marketing/showDocDetail.jsp"> <%=doc_no%></a>
I've created the hyperlink using href tag to the document number in the jsp using the below syntax.
<% String a1 = "Document ";
String a2 = "<a href=\"";
String a3 = "marketing/showDocDetail.jsp\">";
String a4 = doc_no;
String a5 = "</a>";
out.println(a1a2a3a4a5);
%>
When clicked the doc_no is passed to backend RFC and export parameter is retrieved to result.jsp where values along with doc_no are displayed.
the value after clicked is not being passed to action.java class that does the retreival.
Needful, backend class, bom, entry in config.xml is all maintained.
Please help me out with the syntax to pass the parameter value into java classHi Bharathi,
try below.
<%
String a1 = "Document ";
String a2 = "<a href=\"";
String a3 = "marketing/showDocDetail.do?docNo=";
String a4 = doc_no;
String a5 = " \">";
String a6 = doc_no;
String a7 = "</a>";
out.println(a1+a2+a3+a4+a5+a6+a7);
%>
I assume doc_no is java variable contains value of document number
Now create action entry in config.xml file. Suppose "actionDoc.java" class process it.
<action path="/marketing/showDocDetail" type="com.xyz.actions.actionDoc">
<forward name="success" path="/marketing/showDocDetail.jsp"/>
<forward name="error" path="/marketing/showDocDetail.jsp"/>
</action>
We are passing parameter docNo=doc_no to action class actionDoc.java in this class you can retrieve request parameter docNo from request object and then process it as you want.
Let me know if you face any problem or error.
eCommerce Developer
Edited by: Ecommerce Developer on Nov 9, 2009 8:35 AM
Maybe you are looking for
-
Dreamweaver CS4 - Record Insertion Form js error
Hi I'm dreamweaver cs4 and started using the Record Insertion form, I was mainly experimenting with it and just seeing what it could do. However when I get to the wizard i have to wait a few seconds for it to connect to the database and then I get an
-
I'm working on a project and went to open a couple files, but an box pops up that says AN UNKNOWN ERROR HAS OCCURRED. I went to other files and they all say the same thing. What's happening with my Illustrator CS4 files?
-
Vibrance level not recording in action in CS5
I'm trying to record an action in which I set the vibrance level. After creating a new action I add a vibrance adjustment layer and set the slider to "70". I stop the action and when I run it I get the layer added, but the vibrance level is set to
-
Hi, When i am loading data fron One ODS to another ODS it is giving error 'The requested object is locked by another transaction'. I checked in SM12 and RS12 there is no lock objects. Please provide the solution. Regards, vijay
-
Dba tables and views columns comments
does anybody know of some script that would generate comments on all of oracle's dictionnary tables and dynamic views (most probably unrealizable) columns? i wonder why they're not created by default when you create the database. Message was edited b