Making the certain columns as disable.
I am using a Complex UI Element - Table in my Web Dynpro. I am displaying 5 columns which are editable. i want to make disaable a column dynamically. How can we do that ?
Hi Manjunath,
Sorry for the late reply was trying to code the desired functionality. Am not sure whether this is a good way of implementing your task or not but just giving out the way I know...
I had created 2 context nodes.
Node: DROPDOWN is used to store the dropdown values (Jan, Feb...)
Node: TABLE is a dummy node with no attributes used for binding to the table
Declare a variable (say GR_TABLE) of type CL_WD_TABLE in attributes tab of your view. Then in the wddomodifyview method just save the reference of your table UI element into this variable. (NOTE: TABLE is the name which I have given for my TABLE UI element in the view)
method WDDOMODIFYVIEW .
check first_time = abap_true.
wd_this->gr_table ?= view->get_element( id = 'TABLE' ).
endmethod.
Now coming to the main part of creating columns dynamically as per the selected month. I have put a pushbutton beside my DropDownByIndex which the user has to select after making a selction. This button triggers the action ONFETCH. We make use of the 2 classes CL_WD_TABLE & CL_WD_TABLE_COLUMN & the methods REMOVE_ALL_COLUMNS & ADD_COLUMN methods for achieving the desired output. But Manjunath my coding does not include creation of binding for the created columns. You will have to try code that yourself. You can find the necessary methods by going through CL_WD_TABLE & CL_WD_TABLE_COLUMN. Hope that this is helpful for you.
Regards,
Uday
Fill the respective month names in order to appear in the DropDownByIndex.
Coding inside the WDDOINIT method:
METHOD wddoinit .
DATA: lv_node TYPE REF TO if_wd_context_node,
lt_dropdown TYPE ig_componentcontroller=>elements_DROPDOWN,
wa_dropdown TYPE ig_componentcontroller=>element_DROPDOWN.
wa_dropdown-values = 'January'.
append wa_dropdown to lt_dropdown.
wa_dropdown-values = 'February'.
append wa_dropdown to lt_dropdown.
lv_node = wd_context->get_child_node( name = ig_componentcontroller=>wdctx_dropdown ).
lv_node->bind_table( new_items = lt_dropdown ).
ENDMETHOD.
Coding for ONFETCH action triggered by pushbutton:
METHOD ONACTIONONFETCH .
DATA: lv_node TYPE REF TO if_wd_context_node,
lt_dropdown TYPE if_main=>elements_dropdown,
wa_dropdown TYPE if_main=>element_dropdown,
lead_selection_index TYPE i,
lr_column type ref to cl_wd_table_column.
wd_this->gr_table->REMOVE_ALL_COLUMNS( ).
lv_node = wd_context->get_child_node( name = 'DROPDOWN' ).
CALL METHOD lv_node->get_static_attributes_table
IMPORTING
table = lt_dropdown.
lead_selection_index = lv_node->get_lead_selection_index( ).
READ TABLE lt_dropdown INTO wa_dropdown INDEX lead_selection_index.
CASE lead_selection_index.
WHEN '9' or '11' or '4' or '6'. "Sep, Nov, April, June
do 30 times.
lr_column = cl_wd_table_column=>new_table_column( ).
wd_this->gr_table->add_column( index = sy-index
the_column = lr_column ).
enddo.
when '10' or '12' or '1' or '3' or '5' or '7'. " Oct, Dec, Jan, Mar, May, July, Aug
do 31 times.
lr_column = cl_wd_table_column=>new_table_column( ).
wd_this->gr_table->add_column( index = sy-index
the_column = lr_column ).
enddo.
when others. " Feb
do 29 times.
lr_column = cl_wd_table_column=>new_table_column( ).
wd_this->gr_table->add_column( index = sy-index
the_column = lr_column ).
enddo.
ENDCASE.
ENDMETHOD.
Similar Messages
-
How to disable a single cell in a table (and not the whole column)
Hi there,
I've got a webdynpro table with a few columns, rows can be created dynamically through a button in the table toolbar.
Depending on the value of a certain cell I have to disable another cell (in the same row).
I tried to manipulate the view in the modifyview but no joy. I also tried to manipulate the attribute property through the coding below:
DATA lv_knttp TYPE knttp.
lo_nd_kostl = wd_context->path_get_node( path = `MULTIVALUES.KOSTL` ).
lo_el_kostl = lo_nd_kostl->get_element( ).
lo_el_kostl->set_attribute_property(
attribute_name = 'LTEXT'
property = lo_el_kostl->e_property-enabled
value = ''
but it disables the whole column!!!! I just need the cell to be disabled (I thought the code above, through the lead selection, would affect a certain cell only - but I was wrong).
Any ideas?
Thanks!!!Hi,
using cell variants you can do this.,
check this article: [Cell Variants in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants]
Instead of binding the read only property of table as a whole , just bind the read only property of column group of table., You can do this bu drill down the table and select the required column and bind the read only column.,
then In onAction Event of button .,
loop the table, if condition satisfied set the read only property to true else false.,!!
hope this helps u.,
Thanks & regards,
Kiran -
Is it possible to disable datatips in columncharts for certain columns?
Is it possible to disable datatips in columncharts for
certain columns?Hello,
apologizes for the misunderstanding.
Regarding security, you might want to have a look at the forum and http://www.sdn.sap.com/irj/sdn/security.
Back to the original matter, I can tell that modifying or extending the SAP GUI functionality on communication protocol level is quite challenging. The protocol is not published and a binary protocol.
Depending what your intention is, you might want to have a look at [GuiXT|http://www.guixt.com/].
Another approach is to write your own controls for SAP GUI, see [How To Extend SAP GUI for Java with Your Own Java Bean |http://www.sdn.sap.com/irj/sdn/sap-gui?rid=/library/uuid/20e0536f-eaf4-2a10-319d-eb68f8e6cee3] on the [SAP GUI family page|http://www.sdn.sap.com/irj/sdn/sap-gui#section16].
Best regards
Rolf-Martin -
How to disable certain columns of a Table?
hi all,
I wish to fill a pattern of 8 digital signals (only 1's & 0's) in a Table.
Is there any way to restrict the user from typing char or num other than a 1 or a 0?
Since the table is a string, I'm having confusion how to do this.
Secondly, the table would have by default 12 columns visible on the Front Panel, excluding both the headers.
But the No. of Columns is based on a parameter called Duration that ranges between 4 & 256.
What I want the user to do is to key in 1's & 0's for the Duration chosen.
Since it'll be tedious to key in for large values of Duration, I've given the option of Set Row(s) & Reset Row(s),
that will fill with either 1 or 0 respectively for the chosen Row Value.
Is there any way to disable the remaining columns of the Table, ie, those unfilled columns,
when the user scrolls horizontally? I don't know how to achieve this.
I went thro' the Properties of the Table, I don't understand some of their functionalities,
like SelStart, SelSize etc.
I wonder why a Property like Disable Array Elements for Arrays is not provided for a Table
to Disable the columns we want to do so, or is it my gross ignorance, I don't know.
Experts pls clarify me & help me out.
Regards,
Partha.
- Partha
LabVIEW - Wires that catch bugs!
Attachments:
Set Eventframe1.vi 409 KBAnother option is to do this:
Slightly more elegant, but also more potential for bugs (e.g. the users can tab into the column).
craigdobis wrote:
You can lower your overhead by using these "professional" looking indicators and controls. They are limited in functions and properties, thereby causing a smaller VI in file size.
Nice. I didn't think about that. Looks like a VI with a single system boolean takes ~20% less space than one with a standard boolean.
P.S. In general, I would say there are considerably better arguments for using system controls than memory issues.
Try to take over the world!
Attachments:
Disabled Column.png 5 KB -
Disabling validations if the first column is empty in an editable table
Hi ,
I'd want to disable validations if the first column in an editable table is empty - coz we'd assume that the user does not want to enter any data in the new row. How can this be done ?Hi Viren,
It is correct that the first line for every Master Data is an empty row, if I am not wrong it derives from SEM settings.
1.If you have some rows with 0CUST_SALES without any attribute it is because you are uploading this MAster Data with a source that does not consider compound objects: it is surely a Transactional DataSource (you do not upload Attributes). So for every Transactional record for which you do not upload also compound objects the system creates a record in your Master Data that is not correct.
2. If you do not have Distr Channel update in Inventory Cube I think you must re-upload all your request starting from PSA. If you have deleted your PSA you can create a DataSource on your cube and feed once again your cube with its same data (built Update Rules that start from Cube and end in the same Cube). Make an upload of all your request and the delete all previous request.
Ciao.
Riccardo. -
Hi, I have been dragging jpeg files into i-movie all week without issue. Now all of a sudden, the selection of jpegs I'm dragging is repeating certain photos and not featuring others, making the entire sequence impossible to view.
Please help, this is urgent for a funeral tomorrow! It didnt happen with any of the other family tributes, they all worked fine.
Many thanks,
RuthIt worked! Thank you! I finally just finished about 20 minutes ago! It took over 26 hours to complete the process you described, but I stuck with it and it worked. I am glad I didn't give up or "forget it" as some might have suggested. That would have set me back until tomorrow!
Ultimately, it turned out there were 45,910 jpgs created. No wonder it took so many hours to render/display them all. It ended up being about 10 hours before it seemed they were all rendered but the process between them displaying and being able to start really deleting them took a few hours because partly I was asleep and also partly it took forever to do anything. Any action as simple as selecting and right-clicking to Get Info, or emptying the trash, would take 20-30 minutes, a couple times longer. The clock stopped many times for 20-30 minutes at a time, a few times over 30 minutes, before catching back up. My cursor never froze which is what really kept me going, although it was a spinning beach ball for most of the time. I was never so relieved to see my regular cursor as opposed to seeing a spinning beach ball as I was early this morning after about 10 hours!
Once I was able to open a Finder window and select all 45,900 files (I had already deleted 10 in the previous couple hours during experimenting of trying to figure out what would work best), then right-click and select to move all the files to the trash, the process of moving them to the trash took 4.5 hours. Then deleting them from the trash took a couple minutes. There were 21.4 GB!!! No wonder the whole process took 26 hours!
mende1, thank you so much! -
Optimize certain columns and fixed others of the same ALV
Hi All,
I was wondering whether it is possible to optimize the width of certain columns based on their content and fixed( hard coding the width ) the others, all fields found in the same ALV.
Thanks,
ShabirHere is what i am using to manage the lenght of the columns.
TRY.
gets the columns object
lref_columns = iref_alv->get_columns( ).
loops trough the columns to hide the unnecessary ones
lt_columns = lref_columns->get( ).
LOOP AT lt_columns INTO ls_column.
lv_colname = ls_column-columnname.
CASE lv_colname.
WHEN 'MANDT'.
ls_column-r_column->set_technical( if_salv_c_bool_sap=>true ).
WHEN 'MATNR'. "Material Number
ls_column-r_column->set_long_text( 'Material Number'(017) ).
ls_column-r_column->set_medium_text( 'Material Number'(017) ).
ls_column-r_column->set_short_text( 'Mat.Number'(036) ).
ls_column-r_column->SET_OUTPUT_LENGTH( '11' ).
WHEN 'MTART'. "Material Type
ls_column-r_column->set_long_text( 'Material Type'(020) ).
ls_column-r_column->set_medium_text( 'Material Type'(020) ).
ls_column-r_column->set_short_text( 'Mat. Type'(037) ).
ls_column-r_column->SET_OUTPUT_LENGTH( '13' ).
WHEN 'MATKL'. "Material Group
ls_column-r_column->set_long_text( 'Material Group'(040) ).
ls_column-r_column->set_medium_text( 'Material Group'(040) ).
ls_column-r_column->set_short_text( 'Mat. Group'(023) ).
ls_column-r_column->set_output_length( '10' ).
WHEN OTHERS.
ENDCASE.
ENDLOOP. -
Disable row selection for certain column in JTable
I have a JTable with several columns, one of which contains an "Info" button. I already have it worked out that when I click on the "Info" button, that event gets passed from the JTable to the button. I have multi-select enabled for the JTable, but I don't want clicking on the "Info" button to change the current selection. I have a klugy "fix" working where I save off the current selection, and then restore it after the user presses the "Info" button. However, this results in "flashing" - the row containing the selected "Info" button becomes selected briefly, then the original selection is restored. How can I avoid this? I would like to just ignore selection events on the "Info" column, but still pass the mouse click event through to the button.
Any suggestions?try this
JTable table = new JTable() {
public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
if (!getColumnModel().getColumn(columnIndex).getIdentifier().equals("Info")) {
super.changeSelection(rowIndex, columnIndex, toggle, extend);
}//else -
Making JTable columns 2- n scrollable, not the first column, how?
Id like for my JTable's first column to always be visible, and columns 2->n to be scrollable. The table also follows the sortable table model found from the swing examples...so if the user sorts any of the columns, all the other columns should sort accordingly.
is there anyway i can separate the first column with the others, so that i can put them in their own scrollpanes (first column just scrolls up/down, and 2->n can scroll either way)?I only glanced at the example at the posted link... if memory servers, the trick was to create one JTable but with two different TableModels. To link the two models, you can simply make the getValueAt method in the fixed model call the getValueAt method of the non-fixed model. It's a bit tricky for beginner, but doable.
;o)
V.V. -
Mtl-secondary_locators - making use of the "primary_locator_flag' column
We are using Oracle Inventory and I would like to assign an item to a subinventory against several locators. I would like to be able to assign one of these locators as the default locator for that part within that subinventory (not within all subinventories). I have looked at the table mtl_secondary_locators and it appears there is a column to do this but I cannot for the life of me find the form which populates it!
I have tried both the item subinventories and stock locators forms from the Inventory responsibility but still am having no luck.
Can anyone please advice?
Thanks,Hi all,
I am facing a similar issue in Oracle Configurator.
Error
The column(s), START_DATE_ACTIVE, must exist. The missing column is either required by the database or required based on the data that is being imported.
Is there a solution ?
Please help.
Thanks,
Rajesh -
Shading certain columns depending on start day of week.
Good Afternoon,
I have reason to edit the calendar wizard to make it completely automated. And before anyone says that this isn't used anymore, we've received 2 separate calendar files over the last made from our Finance departments, each making them with Word calendar
wizard highlighting year end dates. So believe me, the calendar wizard is still very much in use!
Last September, I finally figured out how to automate the first day of the week, though. I have 2 templates now, one for Monday as first day and one for Sunday being the first day of the week.
The only thing missing is to automate the shading so that the columns for Saturday and Sunday are shaded with light grey, and since it's automation we're talking about, only those cells in the columns with a number in them.
I know it's do-able, I'm just not a vb expert, only being able to handle editing simple macros.
But I understand that since I had some help with the macros and they might have changed from the original to some degree, that I should post the code. Is this correct? I hope that it is.
' WORD 97 WIZARD
' Calendar Wizard Specific Code
Option Explicit
' CONSTANT DECLARATIONS
'=============================== LOCALIZATION BLOCK ===============================
' Localization Note: iWeekStartDay is the starting day of the week (Sun = 0, Mon = 1, ...Sat = 6)
Public Const iWeekStartDay As Integer = 1
' Banter strings
Public Const strWarnYearReq As String = "Both starting and ending years are required."
Public Const strWarnMinExceeded As String = "The year can not be before 1900."
Public Const strWarnMaxExceeded As String = "The year can not be after 4095."
Public Const strWarnRangeExceeded As String = "The calendar is limited to 120 months (10 years)."
Public Const strAppCaptionPart1 As String = "Calendar: "
Public Const strAppCaptionPart1b As String = ""
Public Const strAppCaptionPart2 As String = ", "
Public Const strAppCaptionPart3 As String = " to "
Public Const strAppCaptionPart4 As String = ", "
' Status messages
Public Const strStatusIntro As String = "Creating Calendar..."
Public Const strStatusPart1 As String = "Creating "
Public Const strStatusPart2 As String = ", "
Public Const strStatusPart3 As String = "..."
' Assistant
Public Const strCallBackHeading As String = "Do more with the calendar?"
'Margins for A4 size (if wizard changes pagesize to A4)
Public Const sA4_SHORT_MARGIN As Single = 28.8
Public Const sA4_LONG_MARGIN As Single = 57.6
'Margins for Letter size (if wizard changes pagesize to Letter) in pts
Public Const sLETTER_SHORT_MARGIN As Single = 36
Public Const sLETTER_LONG_MARGIN As Single = 36
'========== END LOCALIZATION BLOCK - DO NOT MAKE CHANGES BELOW THIS LINE ==========
Public Const iYearMin As Integer = 1900
Public Const iYearMax As Integer = 4095
' Bookmark Names - DO NOT LOCALIZE
' Note: No spaces allowed in bookmark names
Public Const strBkMkMonth As String = "Month"
Public Const strBkMkDays As String = "Days"
Public Const strBkMkDayNames As String = "DayNames"
Public Const strBkMkYear As String = "Year"
' Calendar Style Names and Constants
Public Const wzBOXES As Integer = 0
Public Const wzBANNER As Integer = 1
Public Const wzJAZZY As Integer = 2
' Form Control
Public Const wzPAGE_START As Integer = 0
Public Const wzPAGE_STYLE As Integer = 1
Public Const wzPAGE_DIRECTION As Integer = 2
Public Const wzPAGE_MONTHS As Integer = 3
Public Const wzPAGE_FINISH As Integer = 4
'orientation
Public Const iORTN_PORTRAIT As Integer = 0
Public Const iORTN_LANDSCAPE As Integer = 1
' Assistant
Public Const iMAX_PANEL As Integer = 4 ' Number of last panel in MultiPage (First=0)
Public Const iCALL_BACK_COUNT As Integer = 3 ' Number of items in CallBackBalloon (First=1)
'postwizard balloon document variable
Public Const strPOST_WIZ_BLN As String = "Calendar post wizard balloon"
' VARIABLE DECLARATIONS
' General
Public rgstrMonthName(11) As String
Public rgstrDayName(6) As String
Public rgiDaysInMonth(11) As String
Public fDateError As Boolean
Public fCheckValidity As Boolean 'if set then the dates are checked for validity
'variables used in doc. creation
Public str1_TO_28 As String
Public rgsDaysHeight(2, 1, 1) As Single
Public rgsMonthNamesHeight(2, 1, 1) As Single
Public rgstrDaysStyle(2) As String
Public rgstrMonthNamesStyle(2) As String
Public strSTY_BANNER_HDG3 As String
' Assistant
Public rgstrAssistantMsg(iMAX_PANEL + 1) As String
Public rgstrCallBackMsg(iCALL_BACK_COUNT) As String
Public rgstrCallBackTip(iCALL_BACK_COUNT) As String
' Page 1
Public iCalendarStyle As Integer
Public iSavedStyle As Integer
' Page 2
' Page 3
' Page 4
Public Sub InitWizardName(fDummy As Boolean)
strWizName = "Calendar Wizard"
strWizLongName = strWizName
strWizShortName = "Calendar"
End Sub
Public Sub InitWizardStrings(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
'=============================== LOCALIZATION BLOCK ===============================
' Note: this list is indexed 0 - iMAX_PANEL
rgstrAssistantMsg(0) = "The Calendar Wizard helps you create a monthly calendar that you can customize with pictures and events. If you want to track and be reminded of events, you should probably use Microsoft Outlook, Microsoft Schedule+, or Microsoft Exchange."
rgstrAssistantMsg(1) = "Select the look you want for your calendar. The Jazzy style uses the Algerian font. If it is not installed on your system, copy alger.ttf from the Valupack folder on the Microsoft Office CD to your hard drive."
rgstrAssistantMsg(2) = "If you leave room for a picture, Word will insert a placeholder picture that you can replace with any picture you want."
rgstrAssistantMsg(3) = "Your calendar can start on any month, and you can make your calendar shorter than or longer than 12 months. Each month will appear on a different page."
rgstrAssistantMsg(4) = "To change any settings, click Back."
' Note: change constant iCALL_BACK_COUNT if number of items in list changes
rgstrCallBackMsg(0) = "Add, remove, or replace a picture"
rgstrCallBackMsg(1) = "Enter information into the calendar"
rgstrCallBackMsg(2) = "Get Help on Something Else..."
rgstrCallBackTip(0) = "To remove a picture, click on it and then press Delete. To add a picture, click where you want to insert the picture, point to Picture on the Insert menu, and then click From File."
rgstrCallBackTip(1) = "To enter information, click where you want to insert the text and start typing. To move between different dates in the calendar, press Tab to move forward or press Shift+Tab to move to the previous date."
'Load Month Name array
rgstrMonthName(0) = "January"
rgstrMonthName(1) = "February"
rgstrMonthName(2) = "March"
rgstrMonthName(3) = "April"
rgstrMonthName(4) = "May"
rgstrMonthName(5) = "June"
rgstrMonthName(6) = "July"
rgstrMonthName(7) = "August"
rgstrMonthName(8) = "September"
rgstrMonthName(9) = "October"
rgstrMonthName(10) = "November"
rgstrMonthName(11) = "December"
'Load Day Name array LOCALIZATION NOTE: DO NOT CHANGE THE ORDER IN WHICH THESE APPEAR!
' TO CHANGE THE WEEK START DAY, CHANGE THE CONSTANT iWeekStartDay
rgstrDayName(0) = "Sun"
rgstrDayName(1) = "Mon"
rgstrDayName(2) = "Tue"
rgstrDayName(3) = "Wed"
rgstrDayName(4) = "Thu"
rgstrDayName(5) = "Fri"
rgstrDayName(6) = "Sat"
'Load Days In Month array
rgiDaysInMonth(0) = 31
rgiDaysInMonth(1) = 28 'Will not be used - must be calculated for leap year accuracy
rgiDaysInMonth(2) = 31
rgiDaysInMonth(3) = 30
rgiDaysInMonth(4) = 31
rgiDaysInMonth(5) = 30
rgiDaysInMonth(6) = 31
rgiDaysInMonth(7) = 31
rgiDaysInMonth(8) = 30
rgiDaysInMonth(9) = 31
rgiDaysInMonth(10) = 30
rgiDaysInMonth(11) = 31
rgstrDaysStyle(wzBOXES) = "Boxes"
rgstrDaysStyle(wzBANNER) = "Banner"
rgstrDaysStyle(wzJAZZY) = "Jazzy"
rgstrMonthNamesStyle(wzBOXES) = "Boxes Heading2"
rgstrMonthNamesStyle(wzBANNER) = "Banner Heading2"
'we dont set the style for month names in Jazzy style
'the Banner style landscape calendar with picture uses Banner Heading3 style for month names
strSTY_BANNER_HDG3 = "Banner Heading3"
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 0) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 1) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 36
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 36
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 0) = 56
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 1) = 102
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 72
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 71
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 0) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 1) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 55
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 51
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 0) = 64
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 1) = 110
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 81
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 81
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 62
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 59
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 40.5
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 81.8
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 58.2
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 57.5
str1_TO_28 = ""
For i = 1 To 28
str1_TO_28 = str1_TO_28 & CStr(i) & vbTab
Next i
'strip off last tab
str1_TO_28 = Left$(str1_TO_28, Len(str1_TO_28) - 1)
' Location in registry DO NOT LOCALIZE
strRegSettingsKey = strREG_SETTINGS_BASE_KEY & "Calendar Wizard"
Exit Sub
FatalError:
ReportError Err
End Sub ' InitWizardStrings
Public Sub InitWizard(fDummy As Boolean)
' Global Vars
fWizardCallBack = False
fDateError = False
iCurrentPanel = 0
' Initialize strings
InitWizardStrings (True)
' Create a new instance of the form
Set formWizard = New formWizDlg
If formWizard Is Nothing Then GoTo FatalError
formWizard.lblWizName1.Caption = " " & strWizLongName & " "
Exit Sub
FatalError:
DisplayErrorMsg strERR_INIT_FORM
ReportError Err
End Sub
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub SaveDialogValues(fDummy As Boolean)
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
System.Cursor = wdCursorWait
StatusBar = strSAVE_SETTINGS
' Assistant
System.PrivateProfileString("", strREG_SETTINGS_BASE_KEY, strREG_ASSISTANT_TIME_STAMP) = Format$(Now, "General Date")
StoreValPref strREG_ASSISTANT_HELP, iLocalState
' Page 1
StoreValPref "iCalendarStyle", iCalendarStyle
' Page 2
StoreValPref "optPortrait", formWizard.optPortrait.Value
StoreValPref "optPictureYes", formWizard.optPictureYes.Value
' Page 3
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsSaved = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
End Sub
Public Sub RestoreDialogValues(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
StatusBar = strRST_SETTINGS
System.Cursor = wdCursorWait
' Page 1
iCalendarStyle = IRestorePref("iCalendarStyle", 0)
Select Case iCalendarStyle
Case wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
Case wzBANNER
formWizard.optBanner.Value = True
formWizard.shpShadowBanner.Visible = True
Case wzJAZZY
formWizard.optJazzy.Value = True
formWizard.shpShadowJazzy.Visible = True
Case Else
iCalendarStyle = wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
End Select
' Page 2
If FRestorePref("optPortrait", False) Then
formWizard.optPortrait.Value = True
formWizard.shpPortraitShadow.Visible = True
formWizard.shpLandscapeShadow.Visible = False
Else
formWizard.optLandscape.Value = True
formWizard.shpPortraitShadow.Visible = False
formWizard.shpLandscapeShadow.Visible = True
End If
formWizard.optPictureYes.Value = FRestorePref("optPictureYes", False)
' Page 3
formWizard.cboMonthStart.ListIndex = Month(Date) - 1
formWizard.cboMonthEnd.ListIndex = Month(Date) - 1
formWizard.txtYearStart = Year(Date)
formWizard.txtYearEnd = Year(Date)
fCheckValidity = False
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsRestored = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
Exit Sub
End Sub ' RestoreDialogValues
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub CreateNewDoc(fDummy As Boolean)
Dim iMonthCurr As Integer
Dim iYearCurr As Integer
Dim lYearMonthCurr As Long
Dim lYearMonthEnd As Long
Dim iDaysCnt As Integer
Dim iDaysInMonth As Integer
Dim iCnt As Integer
Dim strAutoTextName As String
Dim objTableDays As Table
Dim iRow As Integer
Dim iCol As Integer
Dim ocboMonthStart As ComboBox
Dim ocboMonthEnd As ComboBox
Dim otxtYearStart As TextBox
Dim otxtYearEnd As TextBox
Dim strJazzyDayNames As String
Dim objFps As PageSetup
Dim objRng As Range
Dim sShortMargin As Single
Dim sLongMargin As Single
Dim strCaptionTxt As String
Dim iOrientation As Integer
Dim iNoPicture As Integer
Dim i As Integer
Dim strDays As String
On Error GoTo CreateNewDoc_Error
System.Cursor = wdCursorWait
Set ocboMonthStart = formWizard.cboMonthStart
Set ocboMonthEnd = formWizard.cboMonthEnd
Set otxtYearStart = formWizard.txtYearStart
Set otxtYearEnd = formWizard.txtYearEnd
With Application
.ScreenUpdating = False
.StatusBar = strStatusIntro
End With
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
If (formWizard.optPortrait) Then
iOrientation = iORTN_PORTRAIT
Else
iOrientation = iORTN_LANDSCAPE
End If
iNoPicture = Abs(formWizard.optPictureNo.Value)
'the margins have to be changed if papersize was changed in Common
If (fChangeToA4 Or fChangeToLetter) Then
Set objFps = ActiveDocument.PageSetup
If iOrientation = iORTN_LANDSCAPE Then
objFps.Orientation = wdOrientLandscape 'setting paper size in common
'resets orientation to Portrait
If fChangeToA4 Then
sShortMargin = sA4_SHORT_MARGIN
sLongMargin = sA4_LONG_MARGIN
Else
sShortMargin = sLETTER_SHORT_MARGIN
sLongMargin = sLETTER_LONG_MARGIN
End If
Else
If fChangeToA4 Then
sShortMargin = sA4_LONG_MARGIN
sLongMargin = sA4_SHORT_MARGIN
Else
sShortMargin = sLETTER_LONG_MARGIN
sLongMargin = sLETTER_SHORT_MARGIN
End If
End If
With objFps
.TopMargin = sShortMargin
.BottomMargin = sShortMargin
.LeftMargin = sLongMargin
.RightMargin = sLongMargin
End With
End If
strAutoTextName = StrBuildAutoTextName(True)
objWizTemplate.AutoTextEntries(strAutoTextName).Insert objActiveRange, True
If iCalendarStyle <> wzJAZZY Then
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDays).Range
Else
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDayNames).Range
End If
strJazzyDayNames = ""
For iCnt = iWeekStartDay To 6
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
For iCnt = 0 To (iWeekStartDay - 1)
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
'Strip trailing Tab
strJazzyDayNames = Left$(strJazzyDayNames, Len(strJazzyDayNames) - 1)
objActiveRange.Text = strJazzyDayNames
If iCalendarStyle <> wzJAZZY Then
If (iCalendarStyle = wzBANNER) And (iOrientation = iORTN_LANDSCAPE) And (iNoPicture = 0) Then
objActiveRange.Style = strSTY_BANNER_HDG3
Else
objActiveRange.Style = rgstrMonthNamesStyle(iCalendarStyle)
End If
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 1, 7
End If
Set objActiveRange = ActiveDocument.Content
objActiveRange.Copy
iMonthCurr = CInt(ocboMonthStart.ListIndex) + 1
iYearCurr = CInt(otxtYearStart.Text)
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
lYearMonthEnd = (CLng(otxtYearEnd.Text) * 100) + (CLng(ocboMonthEnd.ListIndex) + 1)
'Create each month of the calendar
Do Until lYearMonthCurr > lYearMonthEnd
Application.StatusBar = strStatusPart1 & rgstrMonthName(iMonthCurr - 1) & strStatusPart2 & CStr(iYearCurr) & strStatusPart3
'Set month
If iCalendarStyle = wzJAZZY Then
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = CStr(iMonthCurr)
Else
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = rgstrMonthName(iMonthCurr - 1)
End If
'Set year
ActiveDocument.Bookmarks(strBkMkYear).Range.Text = CStr(iYearCurr)
'Determine number of days in month
If iMonthCurr = 2 Then
iDaysInMonth = DateSerial(iYearCurr, 3, 1) - DateSerial(iYearCurr, 2, 1)
Else
iDaysInMonth = rgiDaysInMonth(iMonthCurr - 1)
End If
'Set Column of First Day Of Month by using Weekday function. The 8th
'is used (to start with) instead of the 1st to allow for offsetting (via
'iWeekStartDay) for localization since the 8th will always fall on the
'same day (of the week) as the 1st.
iCol = WeekDay(DateSerial(iYearCurr, iMonthCurr, 8 - iWeekStartDay))
ActiveDocument.Bookmarks(strBkMkDays).Select
If iCalendarStyle <> wzJAZZY Then _
Selection.MoveDown wdLine 'the bookmark is now in the first cell of the table
strDays = ""
For i = 1 To iCol - 1
strDays = strDays & vbTab
Next i
strDays = strDays & str1_TO_28
For i = 29 To iDaysInMonth
strDays = strDays & vbTab & CStr(i)
Next i
'to get a 6 * 7 table always
For i = iDaysInMonth + iCol - 1 To 41
strDays = strDays & vbTab
Next i
Set objActiveRange = Selection.Range
objActiveRange.Text = strDays
objActiveRange.Style = rgstrDaysStyle(iCalendarStyle) & iOrientation & iNoPicture
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 6, 7
Selection.Cells.Height = rgsDaysHeight(iCalendarStyle, iOrientation, iNoPicture)
Selection.Tables(1).Rows(1).Height = rgsMonthNamesHeight(iCalendarStyle, iOrientation, iNoPicture)
'========================================================
' Mn.Sept.01.2014; 08h21
' TABLE GRIDLINES CODE: Automatically creates printable gridlines in the table.
With Selection.Tables(1).Borders
.InsideLineStyle = wdLineStyleSingle
.InsideLineWidth = wdLineWidth100pt
.InsideColorIndex = wdAuto
.OutsideLineStyle = wdLineStyleSingle
.OutsideLineWidth = wdLineWidth100pt
End With
'========================================================
ActiveDocument.Bookmarks(strBkMkDays).Delete
'Advance the current month
If iMonthCurr = 12 Then
iMonthCurr = 1
iYearCurr = iYearCurr + 1
Else
iMonthCurr = iMonthCurr + 1
End If
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
If lYearMonthCurr <= lYearMonthEnd Then
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
'Insert Page Break
objActiveRange.InsertBreak wdPageBreak
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
objActiveRange.Paste
End If
Loop
Application.StatusBar = ""
strCaptionTxt = ""
'Set Application caption
strCaptionTxt = " - " & strAppCaptionPart1 & strAppCaptionPart1b & ocboMonthStart.Text & strAppCaptionPart2 & otxtYearStart.Text & strAppCaptionPart3 & ocboMonthEnd.Text & strAppCaptionPart4 & otxtYearEnd.Text
ActiveDocument.UndoClear
With ActiveWindow
.Caption = .Caption & strCaptionTxt
With .View
.TableGridlines = False
.ShowDrawings = True
End With
End With
'Position cursor at the top
Selection.HomeKey wdStory
CreateNewDoc_Exit:
Exit Sub
CreateNewDoc_Error:
ReportError Err
GoTo CreateNewDoc_Exit
End Sub ' CreateNewDoc
Public Sub InitCallBack(fDummy As Boolean)
Dim i As Integer
Dim objCallBackLabels As BalloonLabels
On Error GoTo ErrorCallBack
If Not (fBlnInitialized) Then
Set objPostWizBln = Assistant.NewBalloon
fBlnInitialized = True
With objPostWizBln
.Heading = strCallBackHeading
.Mode = msoModeModeless
.Button = msoButtonSetCancel
.BalloonType = msoBalloonTypeButtons
.Callback = "Calendar.fnCallBack"
End With
Set objCallBackLabels = objPostWizBln.Labels
objCallBackLabels.Count = iCALL_BACK_COUNT
For i = 1 To iCALL_BACK_COUNT
objCallBackLabels.Item(i).Text = rgstrCallBackMsg(i - 1)
Next i
End If
objPostWizBln.Show
If (Assistant.BalloonError) Then GoTo ErrorCallBack
fPostWizBlnOpen = True
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "1"
Exit Sub
ErrorCallBack:
DisplayErrorMsg strERR_INIT_CALL_BACK
fPostWizBlnOpen = False
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "0"
End Sub
Public Function fnCallBack(objBln As Balloon, iBtn As Integer, lPrivate As Long)
On Error GoTo ErrorCallBack
Select Case iBtn
Case Is < 1 'Exit
objBln.Close
fPostWizBlnOpen = False
ActiveDocument.Variables(strPOST_WIZ_BLN).Value = "0"
RestoreAssistant (True)
Case 1 'Remove existing picture
DisplayTip rgstrCallBackTip(0)
Case 2 'Enter information into calendar
DisplayTip rgstrCallBackTip(1)
Case 3 ' Get help
Assistant.Help
End Select
Exit Function
ErrorCallBack:
DisplayErrorMsg Err.Description
End Function
Private Function StrBuildAutoTextName(fDummy As Boolean) As String
Dim strATName As String
On Error GoTo BuildAutoTextName_Error
'Select base AutoText Name NOTE: DO NOT LOCALIZE
Select Case iCalendarStyle
Case wzBOXES
strATName = "Boxes"
Case wzBANNER
strATName = "Banner"
Case wzJAZZY
strATName = "Jazzy"
End Select
strATName = strATName & CStr(Abs(formWizard.optLandscape.Value))
strATName = strATName & CStr(Abs(formWizard.optPictureNo.Value))
StrBuildAutoTextName = strATName
BuildAutoTextName_Exit:
Exit Function
BuildAutoTextName_Error:
StrBuildAutoTextName = ""
Resume BuildAutoTextName_Exit
End Function
'displays a tip during post-wizard options
'assumes that Assistant is present since it is called from post-wizard balloon
Private Sub DisplayTip(strTip As String)
Dim objBlnTip As Balloon
On Error GoTo FatalError
Set objBlnTip = Assistant.NewBalloon
With objBlnTip
.Mode = msoModeModal
.Heading = strWizName
.Text = strTip
.Button = msoButtonSetOK
End With
objBlnTip.Show
If Assistant.BalloonError <> msoBalloonErrorNone Then GoTo FatalError
Exit Sub
FatalError:
Err.Clear
End Sub
The above is from the module labelled "Calendar". I don't believe anything was altered in the module labelled "Common", but please let me know that I should post it.
To recap, in this wizard file, the first day of the week is set for Monday. So the Saturday and Sunday columns always fall as the last 2 columns in the calendar table (Sunday as first day has the 1st and last column as the ones that would need shading).
How can that syntax be added to shade the last 2 columns in the Monday calendar wizard, and the 1st and last column for the Sunday calendar wizard and hopefully shading just those particular cells in either with numbers in them?
Thank you! Very much appreciated.Thanks, Doug! Works beautifully. I tried them again this morning, really incredible!
I'm going to keep the Monday and Sunday wizard files as separate files because I realized that I don't have the skills (or the time) to try to figure out how to modify it so the user is requested the starting day. It'll be beyond my meager skills,
I'm sure, especially since there are all those dialogue boxes to contend with at the wizard's start. I was forgetting about those. So leaving these as 2 separate files where one chooses the starting day as per the title, the Monday one for Monday
and the other, the Sunday one, for a Sunday start day.
However, the only difference between them at this point is that one has a "0" for Sunday and the other a "1" for Monday, at the appropriate spots in the code. being the starting week day and the other a "1" for Monday.
That's it. They're beautifully the same in the rest of the code. And a further benefit is that only one module was touched at all for all of this, the Calendar module (leaving the one labelled "Common" untouched.
So anyone with a calendar wizard file can just change the piece of code below (begging the group's indulgence, if I may, in posting the modified code (??):
' WORD 97 WIZARD
' Calendar Wizard Specific Code
Option Explicit
' CONSTANT DECLARATIONS
'=============================== LOCALIZATION BLOCK ===============================
' Localization Note: iWeekStartDay is the starting day of the week (Sun = 0, Mon = 1, ...Sat = 6)
Public Const iWeekStartDay As Integer = 1
' Banter strings
Public Const strWarnYearReq As String = "Both starting and ending years are required."
Public Const strWarnMinExceeded As String = "The year can not be before 1900."
Public Const strWarnMaxExceeded As String = "The year can not be after 4095."
Public Const strWarnRangeExceeded As String = "The calendar is limited to 120 months (10 years)."
Public Const strAppCaptionPart1 As String = "Calendar: "
Public Const strAppCaptionPart1b As String = ""
Public Const strAppCaptionPart2 As String = ", "
Public Const strAppCaptionPart3 As String = " to "
Public Const strAppCaptionPart4 As String = ", "
' Status messages
Public Const strStatusIntro As String = "Creating Calendar..."
Public Const strStatusPart1 As String = "Creating "
Public Const strStatusPart2 As String = ", "
Public Const strStatusPart3 As String = "..."
' Assistant
Public Const strCallBackHeading As String = "Do more with the calendar?"
'Margins for A4 size (if wizard changes pagesize to A4)
Public Const sA4_SHORT_MARGIN As Single = 28.8
Public Const sA4_LONG_MARGIN As Single = 57.6
'Margins for Letter size (if wizard changes pagesize to Letter) in pts
Public Const sLETTER_SHORT_MARGIN As Single = 36
Public Const sLETTER_LONG_MARGIN As Single = 36
'========== END LOCALIZATION BLOCK - DO NOT MAKE CHANGES BELOW THIS LINE ==========
Public Const iYearMin As Integer = 1900
Public Const iYearMax As Integer = 4095
' Bookmark Names - DO NOT LOCALIZE
' Note: No spaces allowed in bookmark names
Public Const strBkMkMonth As String = "Month"
Public Const strBkMkDays As String = "Days"
Public Const strBkMkDayNames As String = "DayNames"
Public Const strBkMkYear As String = "Year"
' Calendar Style Names and Constants
Public Const wzBOXES As Integer = 0
Public Const wzBANNER As Integer = 1
Public Const wzJAZZY As Integer = 2
' Form Control
Public Const wzPAGE_START As Integer = 0
Public Const wzPAGE_STYLE As Integer = 1
Public Const wzPAGE_DIRECTION As Integer = 2
Public Const wzPAGE_MONTHS As Integer = 3
Public Const wzPAGE_FINISH As Integer = 4
'orientation
Public Const iORTN_PORTRAIT As Integer = 0
Public Const iORTN_LANDSCAPE As Integer = 1
' Assistant
Public Const iMAX_PANEL As Integer = 4 ' Number of last panel in MultiPage (First=0)
Public Const iCALL_BACK_COUNT As Integer = 3 ' Number of items in CallBackBalloon (First=1)
'postwizard balloon document variable
Public Const strPOST_WIZ_BLN As String = "Calendar post wizard balloon"
' VARIABLE DECLARATIONS
' General
Public rgstrMonthName(11) As String
Public rgstrDayName(6) As String
Public rgiDaysInMonth(11) As String
Public fDateError As Boolean
Public fCheckValidity As Boolean 'if set then the dates are checked for validity
'variables used in doc. creation
Public str1_TO_28 As String
Public rgsDaysHeight(2, 1, 1) As Single
Public rgsMonthNamesHeight(2, 1, 1) As Single
Public rgstrDaysStyle(2) As String
Public rgstrMonthNamesStyle(2) As String
Public strSTY_BANNER_HDG3 As String
' Assistant
Public rgstrAssistantMsg(iMAX_PANEL + 1) As String
Public rgstrCallBackMsg(iCALL_BACK_COUNT) As String
Public rgstrCallBackTip(iCALL_BACK_COUNT) As String
' Page 1
Public iCalendarStyle As Integer
Public iSavedStyle As Integer
' Page 2
' Page 3
' Page 4
Public Sub InitWizardName(fDummy As Boolean)
strWizName = "Calendar Wizard"
strWizLongName = strWizName
strWizShortName = "Calendar"
End Sub
Public Sub InitWizardStrings(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
'=============================== LOCALIZATION BLOCK ===============================
' Note: this list is indexed 0 - iMAX_PANEL
rgstrAssistantMsg(0) = "The Calendar Wizard helps you create a monthly calendar that you can customize with pictures and events. If you want to track and be reminded of events, you should probably use Microsoft Outlook, Microsoft Schedule+, or Microsoft Exchange."
rgstrAssistantMsg(1) = "Select the look you want for your calendar. The Jazzy style uses the Algerian font. If it is not installed on your system, copy alger.ttf from the Valupack folder on the Microsoft Office CD to your hard drive."
rgstrAssistantMsg(2) = "If you leave room for a picture, Word will insert a placeholder picture that you can replace with any picture you want."
rgstrAssistantMsg(3) = "Your calendar can start on any month, and you can make your calendar shorter than or longer than 12 months. Each month will appear on a different page."
rgstrAssistantMsg(4) = "To change any settings, click Back."
' Note: change constant iCALL_BACK_COUNT if number of items in list changes
rgstrCallBackMsg(0) = "Add, remove, or replace a picture"
rgstrCallBackMsg(1) = "Enter information into the calendar"
rgstrCallBackMsg(2) = "Get Help on Something Else..."
rgstrCallBackTip(0) = "To remove a picture, click on it and then press Delete. To add a picture, click where you want to insert the picture, point to Picture on the Insert menu, and then click From File."
rgstrCallBackTip(1) = "To enter information, click where you want to insert the text and start typing. To move between different dates in the calendar, press Tab to move forward or press Shift+Tab to move to the previous date."
'Load Month Name array
rgstrMonthName(0) = "January"
rgstrMonthName(1) = "February"
rgstrMonthName(2) = "March"
rgstrMonthName(3) = "April"
rgstrMonthName(4) = "May"
rgstrMonthName(5) = "June"
rgstrMonthName(6) = "July"
rgstrMonthName(7) = "August"
rgstrMonthName(8) = "September"
rgstrMonthName(9) = "October"
rgstrMonthName(10) = "November"
rgstrMonthName(11) = "December"
'Load Day Name array LOCALIZATION NOTE: DO NOT CHANGE THE ORDER IN WHICH THESE APPEAR!
' TO CHANGE THE WEEK START DAY, CHANGE THE CONSTANT iWeekStartDay
rgstrDayName(0) = "Sun"
rgstrDayName(1) = "Mon"
rgstrDayName(2) = "Tue"
rgstrDayName(3) = "Wed"
rgstrDayName(4) = "Thu"
rgstrDayName(5) = "Fri"
rgstrDayName(6) = "Sat"
'Load Days In Month array
rgiDaysInMonth(0) = 31
rgiDaysInMonth(1) = 28 'Will not be used - must be calculated for leap year accuracy
rgiDaysInMonth(2) = 31
rgiDaysInMonth(3) = 30
rgiDaysInMonth(4) = 31
rgiDaysInMonth(5) = 30
rgiDaysInMonth(6) = 31
rgiDaysInMonth(7) = 31
rgiDaysInMonth(8) = 30
rgiDaysInMonth(9) = 31
rgiDaysInMonth(10) = 30
rgiDaysInMonth(11) = 31
rgstrDaysStyle(wzBOXES) = "Boxes"
rgstrDaysStyle(wzBANNER) = "Banner"
rgstrDaysStyle(wzJAZZY) = "Jazzy"
rgstrMonthNamesStyle(wzBOXES) = "Boxes Heading2"
rgstrMonthNamesStyle(wzBANNER) = "Banner Heading2"
'we dont set the style for month names in Jazzy style
'the Banner style landscape calendar with picture uses Banner Heading3 style for month names
strSTY_BANNER_HDG3 = "Banner Heading3"
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 0) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 1) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 36
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 36
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 0) = 56
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 1) = 102
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 72
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 71
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 0) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 1) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 55
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 51
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 0) = 64
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 1) = 110
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 81
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 81
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 62
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 59
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 40.5
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 81.8
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 58.2
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 57.5
str1_TO_28 = ""
For i = 1 To 28
str1_TO_28 = str1_TO_28 & CStr(i) & vbTab
Next i
'strip off last tab
str1_TO_28 = Left$(str1_TO_28, Len(str1_TO_28) - 1)
' Location in registry DO NOT LOCALIZE
strRegSettingsKey = strREG_SETTINGS_BASE_KEY & "Calendar Wizard"
Exit Sub
FatalError:
ReportError Err
End Sub ' InitWizardStrings
Public Sub InitWizard(fDummy As Boolean)
' Global Vars
fWizardCallBack = False
fDateError = False
iCurrentPanel = 0
' Initialize strings
InitWizardStrings (True)
' Create a new instance of the form
Set formWizard = New formWizDlg
If formWizard Is Nothing Then GoTo FatalError
formWizard.lblWizName1.Caption = " " & strWizLongName & " "
Exit Sub
FatalError:
DisplayErrorMsg strERR_INIT_FORM
ReportError Err
End Sub
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub SaveDialogValues(fDummy As Boolean)
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
System.Cursor = wdCursorWait
StatusBar = strSAVE_SETTINGS
' Assistant
System.PrivateProfileString("", strREG_SETTINGS_BASE_KEY, strREG_ASSISTANT_TIME_STAMP) = Format$(Now, "General Date")
StoreValPref strREG_ASSISTANT_HELP, iLocalState
' Page 1
StoreValPref "iCalendarStyle", iCalendarStyle
' Page 2
StoreValPref "optPortrait", formWizard.optPortrait.Value
StoreValPref "optPictureYes", formWizard.optPictureYes.Value
' Page 3
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsSaved = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
End Sub
Public Sub RestoreDialogValues(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
StatusBar = strRST_SETTINGS
System.Cursor = wdCursorWait
' Page 1
iCalendarStyle = IRestorePref("iCalendarStyle", 0)
Select Case iCalendarStyle
Case wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
Case wzBANNER
formWizard.optBanner.Value = True
formWizard.shpShadowBanner.Visible = True
Case wzJAZZY
formWizard.optJazzy.Value = True
formWizard.shpShadowJazzy.Visible = True
Case Else
iCalendarStyle = wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
End Select
' Page 2
If FRestorePref("optPortrait", False) Then
formWizard.optPortrait.Value = True
formWizard.shpPortraitShadow.Visible = True
formWizard.shpLandscapeShadow.Visible = False
Else
formWizard.optLandscape.Value = True
formWizard.shpPortraitShadow.Visible = False
formWizard.shpLandscapeShadow.Visible = True
End If
formWizard.optPictureYes.Value = FRestorePref("optPictureYes", False)
' Page 3
formWizard.cboMonthStart.ListIndex = Month(Date) - 1
formWizard.cboMonthEnd.ListIndex = Month(Date) - 1
formWizard.txtYearStart = Year(Date)
formWizard.txtYearEnd = Year(Date)
fCheckValidity = False
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsRestored = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
Exit Sub
End Sub ' RestoreDialogValues
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub CreateNewDoc(fDummy As Boolean)
Dim iMonthCurr As Integer
Dim iYearCurr As Integer
Dim lYearMonthCurr As Long
Dim lYearMonthEnd As Long
Dim iDaysCnt As Integer
Dim iDaysInMonth As Integer
Dim iCnt As Integer
Dim strAutoTextName As String
Dim objTableDays As Table
Dim iRow As Integer
Dim iCol As Integer
Dim ocboMonthStart As ComboBox
Dim ocboMonthEnd As ComboBox
Dim otxtYearStart As TextBox
Dim otxtYearEnd As TextBox
Dim strJazzyDayNames As String
Dim objFps As PageSetup
Dim objRng As Range
Dim sShortMargin As Single
Dim sLongMargin As Single
Dim strCaptionTxt As String
Dim iOrientation As Integer
Dim iNoPicture As Integer
Dim i As Integer
Dim strDays As String
On Error GoTo CreateNewDoc_Error
System.Cursor = wdCursorWait
Set ocboMonthStart = formWizard.cboMonthStart
Set ocboMonthEnd = formWizard.cboMonthEnd
Set otxtYearStart = formWizard.txtYearStart
Set otxtYearEnd = formWizard.txtYearEnd
With Application
.ScreenUpdating = False
.StatusBar = strStatusIntro
End With
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
If (formWizard.optPortrait) Then
iOrientation = iORTN_PORTRAIT
Else
iOrientation = iORTN_LANDSCAPE
End If
iNoPicture = Abs(formWizard.optPictureNo.Value)
'the margins have to be changed if papersize was changed in Common
If (fChangeToA4 Or fChangeToLetter) Then
Set objFps = ActiveDocument.PageSetup
If iOrientation = iORTN_LANDSCAPE Then
objFps.Orientation = wdOrientLandscape 'setting paper size in common
'resets orientation to Portrait
If fChangeToA4 Then
sShortMargin = sA4_SHORT_MARGIN
sLongMargin = sA4_LONG_MARGIN
Else
sShortMargin = sLETTER_SHORT_MARGIN
sLongMargin = sLETTER_LONG_MARGIN
End If
Else
If fChangeToA4 Then
sShortMargin = sA4_LONG_MARGIN
sLongMargin = sA4_SHORT_MARGIN
Else
sShortMargin = sLETTER_LONG_MARGIN
sLongMargin = sLETTER_SHORT_MARGIN
End If
End If
With objFps
.TopMargin = sShortMargin
.BottomMargin = sShortMargin
.LeftMargin = sLongMargin
.RightMargin = sLongMargin
End With
End If
strAutoTextName = StrBuildAutoTextName(True)
objWizTemplate.AutoTextEntries(strAutoTextName).Insert objActiveRange, True
If iCalendarStyle <> wzJAZZY Then
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDays).Range
Else
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDayNames).Range
End If
strJazzyDayNames = ""
For iCnt = iWeekStartDay To 6
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
For iCnt = 0 To (iWeekStartDay - 1)
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
'Strip trailing Tab
strJazzyDayNames = Left$(strJazzyDayNames, Len(strJazzyDayNames) - 1)
objActiveRange.Text = strJazzyDayNames
If iCalendarStyle <> wzJAZZY Then
If (iCalendarStyle = wzBANNER) And (iOrientation = iORTN_LANDSCAPE) And (iNoPicture = 0) Then
objActiveRange.Style = strSTY_BANNER_HDG3
Else
objActiveRange.Style = rgstrMonthNamesStyle(iCalendarStyle)
End If
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 1, 7
End If
Set objActiveRange = ActiveDocument.Content
objActiveRange.Copy
iMonthCurr = CInt(ocboMonthStart.ListIndex) + 1
iYearCurr = CInt(otxtYearStart.Text)
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
lYearMonthEnd = (CLng(otxtYearEnd.Text) * 100) + (CLng(ocboMonthEnd.ListIndex) + 1)
'Create each month of the calendar
Do Until lYearMonthCurr > lYearMonthEnd
Application.StatusBar = strStatusPart1 & rgstrMonthName(iMonthCurr - 1) & strStatusPart2 & CStr(iYearCurr) & strStatusPart3
'Set month
If iCalendarStyle = wzJAZZY Then
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = CStr(iMonthCurr)
Else
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = rgstrMonthName(iMonthCurr - 1)
End If
'Set year
ActiveDocument.Bookmarks(strBkMkYear).Range.Text = CStr(iYearCurr)
'Determine number of days in month
If iMonthCurr = 2 Then
iDaysInMonth = DateSerial(iYearCurr, 3, 1) - DateSerial(iYearCurr, 2, 1)
Else
iDaysInMonth = rgiDaysInMonth(iMonthCurr - 1)
End If
'Set Column of First Day Of Month by using Weekday function. The 8th
'is used (to start with) instead of the 1st to allow for offsetting (via
'iWeekStartDay) for localization since the 8th will always fall on the
'same day (of the week) as the 1st.
iCol = WeekDay(DateSerial(iYearCurr, iMonthCurr, 8 - iWeekStartDay))
ActiveDocument.Bookmarks(strBkMkDays).Select
If iCalendarStyle <> wzJAZZY Then _
Selection.MoveDown wdLine 'the bookmark is now in the first cell of the table
strDays = ""
For i = 1 To iCol - 1
strDays = strDays & vbTab
Next i
strDays = strDays & str1_TO_28
For i = 29 To iDaysInMonth
strDays = strDays & vbTab & CStr(i)
Next i
'to get a 6 * 7 table always
For i = iDaysInMonth + iCol - 1 To 41
strDays = strDays & vbTab
Next i
Set objActiveRange = Selection.Range
objActiveRange.Text = strDays
objActiveRange.Style = rgstrDaysStyle(iCalendarStyle) & iOrientation & iNoPicture
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 6, 7
Selection.Cells.Height = rgsDaysHeight(iCalendarStyle, iOrientation, iNoPicture)
Selection.Tables(1).Rows(1).Height = rgsMonthNamesHeight(iCalendarStyle, iOrientation, iNoPicture)
'================================================================================================================================
' Tu.Mar.11.2015; 17h56 - MVPEdits/MyEdits
' SATURDAY and SUNDAY cells get shaded in the table (no matter where they fall).
' Doug Robbins - Word MVP; https://social.msdn.microsoft.com/Forums/office/en-US/6ab55be0-adc0-4e37-9565-8cdff089d20a/shading-certain-columns-depending-on-start-day-of-week?forum=worddev
Dim j As Long
With Selection.Tables(1)
If iWeekStartDay = 1 Then
For i = 6 To 7
With .Columns(i)
' For j = 1 To .Cells.Count ' 1 = Cells with SAT and SUN text are shaded
For j = 2 To .Cells.Count ' 2 = Cells with SAT and SUN text are _ NOT_ shaded
With .Cells(j).Range
If Len(.Text) > 2 Then
.Shading.BackgroundPatternColor = wdColorGray20 'wdColorGray_ _ _ (the number following gives the shade of gray, i.e., wdColorGray20 vs. wdColorGray50)
End If
End With
Next j
End With
Next i
Else
For i = 1 To 7 Step 6
With .Columns(i)
' For j = 1 To .Cells.Count ' 1 = Cells with SAT and SUN text are shaded
For j = 2 To .Cells.Count ' 2 = Cells with SAT and SUN text are _ NOT_ shaded
With .Cells(j).Range
If Len(.Text) > 2 Then
.Shading.BackgroundPatternColor = wdColorGray20 'wdColorGray_ _ _ (the number following gives the shade of gray, i.e., wdColorGray20 vs. wdColorGray50)
End If
End With
Next j
End With
Next i
End If
End With
'================================================================================================================================
'================================================================================================================================
' Mn.Sept.01.2014; 08h21 - MVPEdits/MyEdits
' TABLE GRIDLINES CODE: Automatically creates printable gridlines in the table.
With Selection.Tables(1).Borders
.InsideLineStyle = wdLineStyleSingle
.InsideLineWidth = wdLineWidth100pt
.InsideColorIndex = wdAuto
.OutsideLineStyle = wdLineStyleSingle
.OutsideLineWidth = wdLineWidth100pt
End With
'================================================================================================================================
ActiveDocument.Bookmarks(strBkMkDays).Delete
'Advance the current month
If iMonthCurr = 12 Then
iMonthCurr = 1
iYearCurr = iYearCurr + 1
Else
iMonthCurr = iMonthCurr + 1
End If
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
If lYearMonthCurr <= lYearMonthEnd Then
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
'Insert Page Break
objActiveRange.InsertBreak wdPageBreak
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
objActiveRange.Paste
End If
Loop
Application.StatusBar = ""
strCaptionTxt = ""
'Set Application caption
strCaptionTxt = " - " & strAppCaptionPart1 & strAppCaptionPart1b & ocboMonthStart.Text & strAppCaptionPart2 & otxtYearStart.Text & strAppCaptionPart3 & ocboMonthEnd.Text & strAppCaptionPart4 & otxtYearEnd.Text
ActiveDocument.UndoClear
With ActiveWindow
.Caption = .Caption & strCaptionTxt
With .View
.TableGridlines = False
.ShowDrawings = True
End With
End With
'Position cursor at the top
Selection.HomeKey wdStory
CreateNewDoc_Exit:
Exit Sub
CreateNewDoc_Error:
ReportError Err
GoTo CreateNewDoc_Exit
End Sub ' CreateNewDoc
Public Sub InitCallBack(fDummy As Boolean)
Dim i As Integer
Dim objCallBackLabels As BalloonLabels
On Error GoTo ErrorCallBack
If Not (fBlnInitialized) Then
Set objPostWizBln = Assistant.NewBalloon
fBlnInitialized = True
With objPostWizBln
.Heading = strCallBackHeading
.Mode = msoModeModeless
.Button = msoButtonSetCancel
.BalloonType = msoBalloonTypeButtons
.Callback = "Calendar.fnCallBack"
End With
Set objCallBackLabels = objPostWizBln.Labels
objCallBackLabels.Count = iCALL_BACK_COUNT
For i = 1 To iCALL_BACK_COUNT
objCallBackLabels.Item(i).Text = rgstrCallBackMsg(i - 1)
Next i
End If
objPostWizBln.Show
If (Assistant.BalloonError) Then GoTo ErrorCallBack
fPostWizBlnOpen = True
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "1"
Exit Sub
ErrorCallBack:
DisplayErrorMsg strERR_INIT_CALL_BACK
fPostWizBlnOpen = False
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "0"
End Sub
Public Function fnCallBack(objBln As Balloon, iBtn As Integer, lPrivate As Long)
On Error GoTo ErrorCallBack
Select Case iBtn
Case Is < 1 'Exit
objBln.Close
fPostWizBlnOpen = False
ActiveDocument.Variables(strPOST_WIZ_BLN).Value = "0"
RestoreAssistant (True)
Case 1 'Remove existing picture
DisplayTip rgstrCallBackTip(0)
Case 2 'Enter information into calendar
DisplayTip rgstrCallBackTip(1)
Case 3 ' Get help
Assistant.Help
End Select
Exit Function
ErrorCallBack:
DisplayErrorMsg Err.Description
End Function
Private Function StrBuildAutoTextName(fDummy As Boolean) As String
Dim strATName As String
On Error GoTo BuildAutoTextName_Error
'Select base AutoText Name NOTE: DO NOT LOCALIZE
Select Case iCalendarStyle
Case wzBOXES
strATName = "Boxes"
Case wzBANNER
strATName = "Banner"
Case wzJAZZY
strATName = "Jazzy"
End Select
strATName = strATName & CStr(Abs(formWizard.optLandscape.Value))
strATName = strATName & CStr(Abs(formWizard.optPictureNo.Value))
StrBuildAutoTextName = strATName
BuildAutoTextName_Exit:
Exit Function
BuildAutoTextName_Error:
StrBuildAutoTextName = ""
Resume BuildAutoTextName_Exit
End Function
'displays a tip during post-wizard options
'assumes that Assistant is present since it is called from post-wizard balloon
Private Sub DisplayTip(strTip As String)
Dim objBlnTip As Balloon
On Error GoTo FatalError
Set objBlnTip = Assistant.NewBalloon
With objBlnTip
.Mode = msoModeModal
.Heading = strWizName
.Text = strTip
.Button = msoButtonSetOK
End With
objBlnTip.Show
If Assistant.BalloonError <> msoBalloonErrorNone Then GoTo FatalError
Exit Sub
FatalError:
Err.Clear
End Sub
Thank you once again for all your help!! Very much appreciated. :D -
ALV List in the same Column for the row CELL i need button or value
Hi,
In my ALV list for the same column I need Button or Value for the different rows (CELL) depending upon my condition.
as well as I have to make read only of 3 rd column CELL based on my first column dropdown value CELL for this Row Only.
Depends upon the value in column 1 / row 2 I have to read only the CELL of column 5 / row 2 ie for the same row.
Depends upon the value in Column 1/ row 3 I have to EDITABLE or Button the CELL of column 5 / row 3 ie for the same row
How to do the logic for this.
I tried and got it for the entire column only.
But my requirement is for the sepecific cell in the column.
Kindly help to proceed further.
Thanks in advance.
DavHere is how you can make a particular cell in the row read-only based on certain conditions.
In my example I am displaying the flight details in an ALV. Here I am checking the airline id and if it is "AA' I am making the cell in the column airline id as readonly. In my example I am putting a check and readonly on the same column. However you can do this for different columns as well.
In order to achieve this you need to add a new context attribute 'READONLY' of type abap_bool to the context node which is bound to data node of ALV.
The method where I populate the node has the following code to populate the data.
data: lr_input_node type ref to if_wd_context_node,
lr_flight_node type ref to if_wd_context_node,
lv_cityfrom type s_from_cit,
lv_cityto type s_to_city,
ls_from type bapisfldst,
ls_to type bapisfldst,
lt_flights type table of bapisfldat,
ls_flights type bapisfldat.
data: lt_final type if_mainview=>elements_node_flighttab,
ls_final type if_mainview=>element_node_flighttab.
* Instantiate the variable lr_input_note to the node NODE_FLIGHT
lr_input_node = wd_context->get_child_node( name = 'NODE_FLIGHT' ).
* Instantiate the variable lr_flight_note to the node NODE_FLIGHTTAB
lr_flight_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' )
* Get the attributes CityFrom und CityTo
lr_input_node->get_attribute( exporting name = 'CITYFROM'
importing value = lv_cityfrom ).
lr_input_node->get_attribute( exporting name = 'CITYTO'
importing value = lv_cityto ).
* Fill the stuctures ls_from and ls_to
ls_from-city = lv_cityfrom.
ls_to-city = lv_cityto.
* Call the function BAPI_FLIGHT_GETLIST
call function 'BAPI_FLIGHT_GETLIST'
exporting
destination_from = ls_from
destination_to = ls_to
tables
flight_list = lt_flights.
Now I am going to check if the airline id is 'AA' and based on that I will fill the readonly context attribute.
loop at lt_flights into ls_flights.
MOVE-CORRESPONDING ls_flights to ls_final.
if ls_flights-airlineid = 'AA'.
ls_final-readonly = abap_true.
else.
ls_final-readonly = abap_false.
endif.
append ls_final to lt_final.
endloop.
Finally bind the data to the context node.
* Bind the data to the node NODE_FLIGHTTAB
lr_flight_node->bind_elements( lt_final ).
Now you need to do the ALV configuration settings.
* create an instance of ALV component
DATA:
lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
lr_salv_wd_table_usage = wd_this->wd_cpuse_alv( ).
IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
lr_salv_wd_table_usage->create_component( ).
ENDIF.
* get ALV component
DATA:
lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
lr_salv_wd_table = wd_this->wd_cpifc_alv( ).
wd_this->alv_config_table = lr_salv_wd_table->get_model( ).
CALL METHOD wd_this->alv_config_table->if_salv_wd_table_settings~set_read_only
EXPORTING
VALUE = ABAP_FALSE
* set visible row count
DATA:
lr_table_settings TYPE REF TO if_salv_wd_table_settings.
lr_table_settings ?= wd_this->alv_config_table.
lr_table_settings->set_visible_row_count( '10' ).
DATA:
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column TYPE REF TO cl_salv_wd_column.
lr_column_settings ?= wd_this->alv_config_table.
DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
lr_column = lr_column_settings->get_column( 'AIRLINEID' ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'AIRLINEID'.
lr_column->set_cell_editor( lr_input_field ).
lr_input_field->set_read_only_fieldname( value = 'READONLY' ).
CALL METHOD lr_column_settings->delete_column
EXPORTING
id = 'READONLY' -
FIX the long backups, not disable them. Solution is here!
NOTE: This process was performed on an iPod Touch 2.0.2 with iTunes 7.7.1.11 on a PC running Windows XP. The process is the same (or similar) for the iPhone.
+*My backups used to take 4 hours. Now they take just minutes, even with 40+ apps*+ installed including large apps like Texas Hold 'em, Brain Challenge, and Vay. No, I am not exaggerating. A fresh sync generally takes no more than 5 minutes from the time I plug my iPod in to the time I disconnect.
I do not guarantee this process will work for you. I can't do that. But it has worked for a lot of other people. This fix is an adaptation from geauxracerx's solution posted here. Read what others have said. I do not take credit for the solution, but I added in a few steps and gave a little more detailed info to fill in the blanks, fix problems and answer the questions I ran into when following geauxracerx's instructions.
Extraordinary long backups are caused by an error when an app (or apps) was installed or updated, particularly if you have ever installed or updated using the App Store on the device itself rather than iTunes. Even if you were never aware that there was a problem, they can arise and will cause problems with the backup process. Maybe you did have a problem during an update or install. Maybe the update stalled, or the App Store crashed. These issues are very likely what have been causing your long backups and you didn't even know it. During the backup process these errors cause it to drag and pause for a very long time before it gets moving again. From your view, you just see a normal backup that is taking hours, and undoubtedly annoying you to no end. On the inside, iTunes is trying desperately to get past a roadblock that it doesn't know where it came from.
This is how to fix the problem. *This is not a quick fix, but it is an effective fix. And it is a FIX, not a band aid.* Depending on how many apps you have installed, this can take several hours to complete. *You will also lose all game scores and any other data stored in your apps.* You will be starting fresh. It is an inconvenience, but in the end, you will be rewarded with quick, efficient backups, the way Apple intended. And you will never have to dread the
iTunes backup again.
The Process:
1. Open iTunes, go to Edit>Preferences>Syncing and remove all previous backups. Also click "Disable automatic syncing for all iPhones and iPods"
2. In your system file structure, locate the backup files for iTunes.
On Windows: C:\Documents and Settings\USERNAME\Application Data\Apple Computer\MobileSync\Backup
On a Mac: Users/YOURACCOUNT/Library/Application Support/MobileSync/Backup
Delete ALL files and folders inside the Backup folder.
3. Plug in iPod. On the Applications tab, uncheck sync apps. Click sync. This will remove all apps on your iPod, it will also backup the ipod. This backup will be very fast, and will recreate the backup folders you deleted in
step 2.
4. If there are any apps left on your ipod, touch and hold the icon until it starts to wiggle, then touch the X to delete the app. Delete all apps left on your ipod. Then sync again.
5. After the sync is complete, disconnect the iPod and do a hard restart by holding down the sleep/power button until the slider appears, slide to power off. Wait 5 seconds and push the power button again and wait for the ipod to boot up.
6. Now begin adding apps back to your ipod one by one. On the Applications tab, click "Sync applications" AND "Selected applications".
7. Click one app and sync. After the sync is complete, right click on your ipod under Devices in the left column of iTunes. Click "Back Up" and allow the backup to complete.
8. Repeat step 7 for each app you want to install. Be sure to backup after each install. As you add more and more apps, the backup will take longer and longer as the process scans apps for changes. An initial backup can also be long for a particularly large application. However, ONLY the initial backup after you install an app will take a long time. Subsequent backups are very quick. Even these "long" backups are just minutes long, sometimes up to 15 minutes in my experience.
9. When you are finished installing and backing up all apps, go to Edit>Preferences>Syncing and enable automatic syncing for all iPhones and iPods.
10. Unplug and plug your device back in just for kicks. Let it back up and sync. Better?
Notes:
The very first time an application is backed up, all critical data is written to your hard drive. This is why the backups are so long the first time. Afterward, only data changes are written, so backups are much shorter.
Backup times will continue to vary based on how many apps were altered since the last sync. If you've used one app since the last backup, your backup will be very short. If you've used 20 apps, the backup will be longer. But you will be rid of the dreaded hour (or more) long backup, that is a promise.
Now that your apps are installed and backing up correctly, the number one rule is to *never, ever install or update apps through the App Store on the iPod*. ONLY install and update through iTunes, and backup after every install or update. The App Store on the iPod is still unstable and can cause lock ups, crashes and freezes. And it is the culprit in these long backup times. Avoid it until the bugs are ironed out.
Also, do not be tempted to disable backups using programs or code edits available online. Your backups are crucial in the event of a restore. Backups contain all of your personal data like game scores, notes, icon arrangement, application data, etc. And it's not a matter of if you'll have to restore one day, it's when, and you'll be glad you have a backup when you do.Thanks for your reply, the trackpad is 9 months old, but it was a christmas present so I dont have the receipt.
Also Im in Dubai, which pretty much means that your warranty lasts as long as they remember your face in the shop buying it!
I have read through over 10 pages of people with the same problem as mine here on the support site, the only variable is different solutions
work for some people, and nothing works for others.
I found turning my iPhone off fixed the problem for 2 days!!
Most people seem to only have the issue with Mavericks, and a few suffered with the Lions.
The movies are playing fine, they just keep pausing and playing continuously from phantom clicks.
Its got so bad now, I dont even have enough control to restart the machine!
I would simply chance buying a new trackpad... but after I received a phantom click about 20 seconds AFTER the pad was switched off, I dont wanna go throwing more money at this needlessly.
I wish Apple would take these sort of things seriously, if I cant get this sorted in a week, Im gonna have to either upgrade my Macbook to Mavericks (which I did before, then spent 2 days reverting back to Snow Leopard)
Or im gonna have to buy a PC and Cubase!
If any one at Apple is reading this (I do believe I just heard an echo!) Some of us rely on your equipment for work, and we do seem to pay a very big premium just for the privilege of the little white logo.
Is there any chance you could show your existing users a hint of respect or common courtesy by taking these issues seriously?
It is after all our loyalty to your brand over the years that put you were you are today. -
Re: [iPlanet-JATO] Finding the database column length
This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
>This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
> -
Why is my ping so high in the first column only when i do a tracert?
When i do a tracert my ping is really high in the first column only on each hop and then it drops to a respectable level. Does anyone know why it is like this on my 4G LTE device? On my dsl when i do the same ping test its pretty even across on each hop. This is what im seeing when i do a ping test on my 4G LTE device.
tracert www.yahoo.com
Tracing route to ds-any-fp3-real.wa1.b.yahoo.com [98.139.183.24]
over a maximum of 30 hops:
1 9 ms 3 ms 3 ms
2 1101 ms 34 ms 38 ms 193.sub-66-174-20.myvzw.com [66.174.20.193]
3 169 ms 55 ms 52 ms 49.sub-69-83-13.myvzw.com [69.83.13.49]
4 52 ms 56 ms 54 ms 194.sub-69-83-13.myvzw.com [69.83.13.194]
5 179 ms 58 ms 57 ms 101.sub-66-174-17.myvzw.com [66.174.17.101]
6 168 ms 57 ms 60 ms TenGigE0-0-1-0.GW14.BOS4.ALTER.NET [152.179.2.97
7 181 ms 58 ms 57 ms 0.ge-0-3-0.XL3.BOS4.ALTER.NET [152.63.17.130]
8 170 ms 59 ms 58 ms 0.ae3.BR1.NYC1.ALTER.NET [152.63.18.222]
9 177 ms 67 ms 59 ms ae11.edge2.NewYork.Level3.net [4.68.62.41]
10 * * * Request timed out.
11 * * * Request timed out.
12 * * * Request timed out.
13 192 ms 49 ms 60 ms ae-4-90.edge4.NewYork1.Level3.net [4.69.155.210]
14 185 ms 51 ms 60 ms YAHOO-INC.edge4.NewYork1.Level3.net [4.28.130.82
15 380 ms 73 ms 129 ms ae-5.pat2.bfz.yahoo.com [216.115.96.67]
16 339 ms 69 ms 146 ms ae-4.msr2.bf1.yahoo.com [216.115.100.73]
17 215 ms 152 ms 80 ms xe-5-0-0.clr2-a-gdc.bf1.yahoo.com [98.139.128.11
18 289 ms 217 ms 217 ms et-17-1.fab6-1-gdc.bf1.yahoo.com [98.139.128.47]
19 187 ms 87 ms 79 ms po-14.bas2-7-prd.bf1.yahoo.com [98.139.129.227]
20 474 ms 314 ms 294 ms ir2.fp.vip.bf1.yahoo.com [98.139.183.24]
Trace complete.hi there
see you never got an answer from vzw
take it you still have the high ping or no ping in my cases
your doing better then i
seems the lte is getting bad with this problem over time as my connection times out causing half loaded web pages and lots of buffering in video playback
i have had 3 tickets in the past 3 month to try and get this fixed but they say cant find anything wrong
and noone else is having the problem here are a few things that seems to have helped me out
1 increase your TTL time till live
this tells your computer to wait a bit longer before giving up and requesting that a packet of info be resent
2 in your computers network settings and reg you can change packet size to a smaller number and add a stop bit to the packet with a time stamp on each packet back in the old days this was what v 90 modems did to get v92 speeds and did help with noisy copper wire dial up and seems to help here too
http://www.dslreports.com/drtcp
is a tool that will help you change your computer setting and reg
use drtcp and the results from this page
http://www.dslreports.com/tweaks
xp win 7 win 8 this will help. vista did it right and dynamically change these settings on the fly and all of step 2 is unnecessary
remember your original settings write them down so you can go back to them should you have problems
also make a restore point and backup your reg before tinkering with windows os
send a private message to me if you need more help or get a computer savvy friend to help you out if you need
3 if your signal noise is under 4G -100bd the lower the better, there is a way to set your android to lte only mode.
more likely to lose data and voice in weak signal areas but great if tethering or hotspotting at home
dail *#*#4636#*#* this is a back door to your android software and is open source code by android os not vzw
and will not unlock your phone voiding warranties. be warned though if you set things wrong in here
you can make more problems be very sure what you change and do one thing at a time so you remember and can dial in again and change it back should you disable something you need. fyi each time you dial in the number it resets to vzw default setting and may look like it did not save setting but it doz. till you dial in again.
good luck
ron
ps im not a vzw rep in any way other then a fellow customer not getting answers.
Maybe you are looking for
-
How do I move my iPhone to a new iTunes installation?
Hi folks, I have a new Windows 7 computer and want to sync my iPhone with it, but iTunes says it's going to delete all of my data. My old computer that I used to sync with is gone; the drive has been reformatted. I don't care about the music on the p
-
Hello fellow Adobe users, moderators, or administrators! Recently I have tried to get "Adobe After Effects CS6" for a YouTube project. I wanted to make an intro. When I downloaded the "Creative Cloud" I scrolled down the list to find that "Adobe Afte
-
Xbox NAT problems - two xbox in same home
I have two xbox, one 360 and the other one xbox one, the 360 is wireless, the xbox one is wired connected, the xbox one always starts with moderate and when both consoles are on at the same time, the xbox one acts very slow. I need someone to tell m
-
Compressor 4 crashes on opening keep getting this warning: The application "Compressor" unexpectedly quit while trying to restore its windows. Do you want to try to restore its windows again? Tried Restoring windows. It crashes again. Tried not = S
-
I cannot open emails in my university's Outlook Web App. I cannot re-open Firefox after I exit because it doesn't really close down (parts still in Task Manager which I have to end before firefox reopens.). I have downloaded installed and re-installe