How to create a textfile dynamically(with in the loop) with given data?
Hi all,
Can anyone Please guide me how to create a text file in the given path dynamically? (with in the loop) with given data.
For example:
<%
String data1="name";
String data2="address";
for(int i=0;i<10;i++)
create the textfile at c:/test/sample.txt//name of the each file created being "sample.txt"
//contents of text file will be
data1+i; //to get name1,name2.....
data2+i// to get add1,add2........
delete(sample.txt) //to enable to create another file in the loop with same name
%>
The code which Ashokan mentioned is not is not creating a file.
i used code given below to create and write into it.
But, not is writing into it. I don't konw, where i am going worng !
Code
String sample2="C:/Ash/sample2.txt";
FileWriter fw = new FileWriter(sample2,true);
BufferedWriter bw=new BufferedWriter(fw);
bw.write("EMP ID");
bw.newLine();
Please help
Regards
aSh
Similar Messages
-
How to create internal table dynamically based on a table entry
hi Experts,
I have table yprod_cat. It has product categories.
In my ABAP program I need to create internal table dynamically based on the number of entries in the table.
For example:
If the table has 3 entries for product category
1. Board
2. Micro
3. Syst
Then create three (3) internal tables.
i_board
i_micro
i_syst
How can we do this? Any sample code will be very usefull
Thanks & Regards
Gopal
Moderator Message: No sample codes can be given. Please search for them or work it!
Edited by: kishan P on Jan 19, 2011 4:22 PMOur APEX version is 4.2We are using below SQL query to display radio groups dynamically..
SELECT APEX_ITEM.RADIOGROUP (1,deptno,'20',dname) dt
FROM dept
ORDER BY 1;
Created a form using SQL type and given abouve SQL query as source.. But when we run the page, there were no radio groups displayed in the page..
Below is the output of the query..
<input type="radio" name="f01" value="10" />ACCOUNTING
<input type="radio" name="f01" value="20" checked="checked" />RESEARCH
<input type="radio" name="f01" value="30" />SALES
<input type="radio" name="f01" value="40" />OPERATIONS
>
If Tabular Form:
Edit Region > Report Attributes > Edit Column > Change the Column type to "Standard Report Column"
If normal Page Item:
Edit Page Item > Security > Escape special characters=No.
Pl read the help on that page item to understand the security risk associated with =NO.
Cheers,
Edited by: Prabodh on Dec 3, 2012 5:59 PM -
How to create some columns dynamically in the report designer depending upon the input selection
Post Author: ekta
CA Forum: Crystal Reports
how to create some columns dynamically in the report designer depending upon the input selection
how export this dynamic report in (pdf , xls,doc and rtf format)
report format is as below:
Element Codes
1
16
14
11
19
10
2
3
Employee nos.
Employee Name
Normal
RDO
WC
Breveavement
LWOP
Sick
Carers leave
AL
O/T 1.5
O/T 2.0
Total Hours
000004
PHAN , Hanh Huynh
68.40
7.60
76.00
000010
I , Jungue
68.40
7.60
2.00
5.00
76.00
000022
GARFINKEL , Hersch
66.30
7.60
2.10
76.00
In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
Can anybody help me how do I design such report....
ThanksHi Developer life,
According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric values) in the details, add an filter to filter the data base on this column group, but if
the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
Similar threads with details steps for your reference:
https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings
If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
Any question, please feel free to let me know.
Best Regards
Vicky Liu -
How to create alv table dynamically by performing action on the button.
Hi all,
my requirement is to create alv table dynamically.
that is i will create two buttons
1) show alv table
2) close alv table
if user selects show alv table then the alv table should be displayed.
and if user selects clsoe alv table then the alv table should be closed.
to create alv table dynamically i have followed this procedure.
under view properties i have added salv_wd_table component. then under the action of showalvbutton i went to code wizard and i have selected instantiate used component component use salv_wd_table. the following code will be generated
with this code i am unable to display alv table dynamically correct me where i went wrong kindly send me the necessary steps how to create alv table dynamically
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_salv_wd_table( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
to close table i have used the following code. with this code i am able to achieve the functionality to delete the alv table
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_salv_wd_table( ).
if lo_cmp_usage->has_active_component( ) is initial.
else.
lo_cmp_usage->Delete_component( ).
endif.
Thanks & Regards,
Naveen
Edited by: naveen.webhelp on Feb 10, 2011 5:52 AMHi
ALV table will be shown in the viewcontainerUI element.
it is shown there empty if you dont fill the node bound to the data node of the interface controller of the comp usage
SALV_WD_TABLE.
and if you are not getting the table filled in the first place.
then check have you mapped the DATA node to some node in the comp controller
wht basically is your requirment is that you want to show ALV gird on click of one button and delete it on click of other button.
there are many ways to do so.
best way is control the visiblity of the viewcontainer UI element which containes the TABLE view of SALV_WD_table comp.
create an attribute of type WDUI_VISIBILITY name say VIS.
now go to the layout and bound hte visible property of the viewcontainer to this attribute VIS.
then in the showalv grid button's eventhandler write
wd_context->set_attribute(
name = 'VIS'
value = '02'
and in the wddoinit and delete alv grid button's event handler write
wd_context->set_attribute(
name = 'VIS'
value = '01'
thanks
sarbjeet singh -
How to create a transaction code for a function group with screen 100 as st
Hello ,
I have requirement where I need to create a function group and create screen 100, 200, 300 and include the function in the screens.
Customer asked me to create a transaction with the screen 100 as the starting screen.
Can you please let me know how to create a transaction code for a function group with screen 100 as starting screen.
[ It is not a module pool program ].
Thanks
Prashanth.
Moderator message - Please ask a specific question and do not ask the forum to do your work for you - post locked
Edited by: Rob Burbank on Jun 2, 2009 11:49 AMGo to transaction SE93, enter a transaction code that you want and click on "create". Enter a text and select the "Transaction with Parameters" button. In the Default Values section, enter START_REPORT in the transaction field. Check the "skip initial screen" box. In the Name of Screen field section enter the following lines:
Name of screen field: Value
D_SREPOVARI-REPORTTYPE RW
D_SREPOVARI-REPORT ZPCA
Save and transport accordingly. -
Populating dynamic values in the combobox with XML form Builder.
I am trying to populate dynamic value in the combobox with xml form builder. I see the document saying create property group and document property Id with respecitive values. I am able to create the property group with system admin -> System config
-> KM -> CM -> Global services -> property Metadata -> groups with new button. and I am trying to create document property Id with value. I am not able to find the way to give value in the property. I am using EP 7.0 Sp 14. Please let me know how to sovel itHi
You can create new property metadata with System Admin > System Config > KM > CM > Global services > Property Metadata > Properties > New. Specify the values for this metadata as the ones you need to have in the combo box. Use allowed values parameter of the matadata to sepcify the values. Each metadata property will have unique property ID and you can map this property ID to your combo box in xml forms.
Give it a try.
Regards,
Yoga -
How to create a ABAP report off of SRM box for live data?
How to create a ABAP report off of SRM box for live data?
Thanks in advance.
York.you can try infoset query:
STEP - A:
1. Go to T Code RSQ02 and give the InfoSet name & select CREATE.
2. Provide the Name(Description) and Data Source i.e. for eg here i take "DIRECT READ OF TABLE" = /BIC/AODS100. Then CONTINUE.
3. Select what to Include in the 3 options available with the POPUP, here "INCLUDE ALL TABLE FIELDS". Then Check the fields and click GENERATE(one RED and WHITE round icon).
4. Now provide the PACKAGE for the INFOSET. Come Back(F3).
STEP - B: optional(If u want to create a new user group)
1. Select ENVIRONMENT -> USER GROUPS. Provide the User Group name and CREATE.
2. Provide Description and SAVE.
3. Provide PACKAGE and SAVE. Come Back (F3) to the Initial Screen.
4. Click Role/User Group Assignment. Select Newly Created User Group or an existing one. Then SAVE (CTRL + S). F3.
STEP - C:
1. Select ENVIRONMENT -> Queries. Provide the query name and CREATE.
2. Select the INFOSET u have created and assigned the user group.
3. Provide the Title and Select BASIC LIST. There you have to select (check) the fields you want to display, SAVE and then TEST. It will ask for Variant, just CONTINUE. -
How to create a form that will allow the applicant to upload their photo
I have Adobe Acrobat 9 Pro Extended and I know how to create forms that require text input.
How to create a form that will allow the applicant to upload their photo? I alo wish to know how to upload a photograph so that I can test the form I created.
Thank you
Adrian Wattstest@ORA10G> with x as (
2 select '234-1111' as customer, to_date('2-Jan-2008','dd-Mon-yyyy') as call_date, 'Order product' as reason from dual union all
3 select '234-1132', to_date('3-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
4 select '231-1154', to_date('4-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
5 select '234-1111', to_date('2-Nov-2007','dd-Mon-yyyy'), 'Order product' from dual union all
6 select '234-1132', to_date('9-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
7 select '231-1154', to_date('9-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
8 select '234-1111', to_date('5-Dec-2007','dd-Mon-yyyy'), 'Order product' from dual union all
9 select '234-1131', to_date('7-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
10 select '231-1154', to_date('1-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
11 select '234-1111', to_date('8-Jan-2008','dd-Mon-yyyy'), 'Order product' from dual union all
12 select '234-1131', to_date('3-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
13 select '231-1154', to_date('4-Nov-2007','dd-Mon-yyyy'), 'Forward to Sales' from dual)
14 --
15 select customer,max(call_date), reason
16 from x
17 where reason = 'Request info'
18 group by customer, reason;
CUSTOMER MAX(CALL_ REASON
231-1154 09-SEP-07 Request info
234-1131 07-DEC-07 Request info
234-1132 09-JAN-08 Request info
test@ORA10G>
test@ORA10G>pratz -
How do I access my external drive over the web with my iPhone. The drive is attached to my Time Machine. I am new to Apple and am trying to get all my stuff working together.
This is not a supported feature of iPhone or Time Capsule.
-
How to Create one more SOA-INFRA under the same domain in weblogic server
Hi All,
Can anybody can guide how to create one more soa-infra under the same domain. In order to maintain my composites to be deployed into
different domains, I need to create one more soa-infra and deployed all the composites under that one.
Please let me know if any demo is available for this activity to be gets completed.
Regards,
CHHi Vijay,
There are several composites which needs to be deployed and maintained in the server. So, we I'm trying to maintian
by deploying composites into 3 different SOA-INFRA's so if one is not accessible, we can look into it and others can access the
composites from another SOA-INFRA instead of creating domains.
Let me know what will be feasible way to perform this activity.
Regards,
CH -
How do i turn off apps running in the background with the new upgrade?
how do i turn off apps running in the background with the new upgrade?
They changed it a bit, but you can still close apps. Double click the Home button to pull up the currently running apps. Side scroll over to the app you want to close, then swipe up on the app *window* (not the icon at the bottom).
= L.I. -
How to create automatic creation of BP from customer and vendor master data
Hi gurus,
can any one tell how to create automatic creation of BP from customer and vendor master data.
Please give me the steps.
Thanks
Sasikanth.HI,
Goto SPRO\ Cross application components \ Master data synchronization \ Synchronization control.
Assign account groups of customer and vendors to respective BP grouping. This setting is enough to create BP in background while creating customer / vendor. But the fields groups are very much important, ensure mandatory fields should be sync.
rgds,
Srini -
HT201365 how do i turn off apps running in the background with ios7 on my 4s phone?
how do i turn off apps running in the background with ios7 on my 4s phone
Double Tap on HomeButton -> slide to that App you wish to Quit -> Swipe from Bottom to Upper Side Display
-
How can i stop apps from running in the background with the new ios7 update
How can i stop apps from running in the background with the new ios7 update
Double tap the Home button...slide the last used view of the app(above the icon) up. Tap Home button when finished.
-
How do you stop apps from running on the iPad with the new ios7?
How do you stop apps from running on the IPad with the new ios7? I have an app for animation that pops up a message to stop other apps from running. If I press onto a app and it starts shaking there are no -, just x's.
Close inactive apps
1. Double tap the home button to bring up the multi-tasking view
2. Swipe the app's windows upwards to close
3. The app will fly off the screen
http://support.apple.com/kb/ht5137
Maybe you are looking for
-
ALL peripherals do not work. No usb,displayport,ethernet
I've tried to find a similar thread but each one seems to be item specific and not all. My problem seems to be all peripherals (anything that plugs in the back) do not appear to be functioning. The unit turns on and off, that's it. I have a 3,1 mac
-
LoadSound not working in IE but works in Firefox??! Help!
Greetings all, I've posted this in the general forum with no luck, so I thought I'd try here. Situation: A simple flash movie, using a loadSound method, works correctly in FireFox/Safari in our production environment, but IE will NOT play any sound.
-
How to export data from Elimination Value dimension member by HAL HFM adapter?
Good day!<BR><BR>Is it possible to export HFM 4.0.5 data with HAL from the <Elimination> Value dimension member?<BR><BR>In 3.* versions it wasn't and there is Known Issue in the "HFM 3.* Adapter Read Me" file: "The Hyperion Financial Management Adapt
-
Hi, How to save full chart image after zooming chart areas in windows form application programmatically with C#. Thanks, Purna
-
i have got this error Error inserting valuejava.sql.SQLException: General error dring inserting record in databse here is my code import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import java.sql.*; import jav